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

HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...how to debug a scheduled taskhow to debug a scheduled task
Previous
 
Next
New Post
4/1/2012 4:51 PM
 

Hi

 I have built a basic dnn scheduled task along the lines of this post:

http://kemmis.info/blog/archive/2008/03/08/how-to-write-a-custom-dotnetnuke-schedulerclient-i.e.-a-scheduled.aspx

However, I am new to this kind of stuff and I can't work out how to debug programme.  I can add another project to VS,either a console app or .net web site with a reference to my class library but how to I call/run the task?

Can someone point me in the right direction?

thanks

gus


"if the only tool you have is a hammer you tend to see every problem as a nail" http://www.carawaydesign.com
 
New Post
4/1/2012 8:39 PM
 
Hi,
Compile in debug, put the dll in your bin folder. In VS with your project still loaded, go to Debug > Attach to Process. Then choose w3wp.exe. Put a breakpoint at your dowork and it should hit the next time the scheduler runs.
Thanks
Mike
 
New Post
4/2/2012 11:37 AM
 

thanks

that works!

It's great to test the final run.However, it is a pain to do a lot of coding though. I keep having to go back and forth copying the dll into the bin and re-attaching etc. A lot of key presses.

What i really need is to be able to test the code as if it had nothing to do with dnn and then build and test and debug as you suggest for the final few builds.  What I have been doing is writing the code in a simple user control, testing it and then pasting it across into the scheduled task module when I'm done.  But that's not ideal either.

how can I call the schedule code from some other code?

Gus


"if the only tool you have is a hammer you tend to see every problem as a nail" http://www.carawaydesign.com
 
New Post
4/2/2012 8:59 PM
 
Well, I typically put as much business logic in a different file. Say FunWork(). So in my scheduler, it looks like:
DoWork()
{
FunWork();
}


Then in my admin i have a button somewhere

void Test_Click( Object sender, EventArgs e )
{
FunWork();
}


Once you have all the bugs worked out. Do some thorough testing through the Scheduler because it's an different animal executing code from the scheduler as opposed to normal DNN process.

Also, you can change your compile destination to point directly to your bin folder so you don't have to copy the dll.
Thanks
Mike
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...how to debug a scheduled taskhow to debug a scheduled task


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