Saturday, June 10, 2006

Scheduled Task in DotNetNuke 4.0

DotNetNuke offers the possibility of schedule some tasks. In this document you will get the instructions to create a scheduled task. This is valid for .NET framework 1.1. The problem is that we need to specify where the assembly that contains the scheduled task is, and the compilation model in ASP.NET 2.0 compiles our classes dynamically and we cannot know what the assembly that contains the class is.

In this post of Shaun Walker we can get a solution. He proposes to publish our web site in order to get the assemblies of our portal. This solution is a good solution when you need to deploy the website, but when you are developing the scheduled tasks you have to publish all website to get the assembly. This is a waste of time and it is not necessary. We can generate the assembly from the command line in a few seconds. These are the steps:

  1. Create a SchedulerClient task. The class in the above document can be used as example.
  2. Save the file as “Scheduler.cs” for example.
  3. Compile the assembly from command line. If you are using VS 2005 you can do it from “Visual Studio 2005 Command Prompt” inside “Visual Studio Tools”. A valid command might be:
    csc /target:library /out:Scheduler.dll /r:.\ReferenceAssembly.dll,
    .\DotNetNuke.dll /recurse:Scheduler.cs

  4. Copy the generated assembly (Scheduler.dll) in the bin directory of the DotNetNuke portal.
  5. At this point you can follow the instructions in the document to configure the scheduled task.

1 Comments:

At 5:15 PM, Anonymous Anonymous said...

The document you link to explain this information does not allow folks to view it. We are getting 'you do not have permission to view this document'. Can you correct the issue or post another link to the doc that works?

 

Post a Comment

<< Home