Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Application_Start - wonApplication_Start - won't start!
Previous
 
Next
New Post
4/6/2007 6:30 PM
 

I'm using Scheduler - it works just fine on timed tasks.  I've been wrestling trying to get a simple task to start based on the Application_Start event.  The best that happens is that in the Schedule list the 'Next Start' time gets set to when the application starts - but the code never runs.    (I've tested it by setting a time lapse - and then it runs fine...)

The parameters I use to set this up are:

  • Full Class Name: RSL.RSLStartup (again, works with a time lapse)
  • Schedule enabled: true
  • Time lapse: left blank
  • Retry frequency: left blank
  • Retain schedule history: None (I've tried 25 as well)
  • Run on event: APPLICATION_START
  • Catch up enabled: not checked
  • Object dependencies: none
  • Run on servers: none

The code is (in namespace RSL)

public

class RSLStartup : DotNetNuke.Services.Scheduling.SchedulerClient

{

 

{

ScheduleHistoryItem = objScheduleHistoryItem;

}

 

 

{

 

}

}

public RSLStartup(DotNetNuke.Services.Scheduling.ScheduleHistoryItem objScheduleHistoryItem) : base()public override void DoWork()try

{

Progressing();

RSL.

ScheduleHistoryItem.Succeeded =

ScheduleHistoryItem.AddLogNote(

}

 

{

ScheduleHistoryItem.Succeeded =

ScheduleHistoryItem.AddLogNote(

Errored(

}

RSLBase.vInitialize();true;"Startup");catch (Exception err)false;"Startup EXCEPTION: " + err.Message);ref err);


Thanks!!!

 
New Post
4/7/2007 5:26 AM
 

oops - better code presentation...

public class RSLStartup : DotNetNuke.Services.Scheduling.SchedulerClient
{
  public RSLStartup(DotNetNuke.Services.Scheduling.ScheduleHistoryItem objScheduleHistoryItem)
  {
    ScheduleHistoryItem = objScheduleHistoryItem;
  }
  public override void DoWork()
  {
    try
    {
       RSL.RSLBase.vInitialize();
       ScheduleHistoryItem.Succeeded = true;
       ScheduleHistoryItem.AddLogNote("Startup");
    }
    catch (Exception err)
    {
       ScheduleHistoryItem.Succeeded = false;
       ScheduleHistoryItem.AddLogNote("Startup EXCEPTION: " + err.Message);
    }
  }
}
 
New Post
4/7/2007 10:30 PM
 

If the scheduler mode is set to Timer, and you have a task which is assigned to run on Application_Start, this will crash DNN on the next app restart and it will never load. I found this in testing and it is known in the core. If the scheduler mode was set to Request (which it is by default) this shouldn't be a problem. After some discussions w/ Shaun, I don't really see a reason you need to assign a task to Application_Start for 99% of use cases.

 


Chris Paterra

Get direct answers to your questions in the Community Exchange.
 
New Post
4/10/2007 3:14 PM
 

Okay, all I'm looking for is the proper place to plug in my initialization code.  

From googling one answer is to have a static class initializer - which seems to work fine.  I was looking for what might be the 'right' way, especially as I'd like to use DNN functionality in this routine - things like exception logging, etc.

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Application_Start - wonApplication_Start - won't start!


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out