M.R.
M.R.

Reputation: 4827

Sitecore debug task scheduler

I conifgured the sitecore task scheduler to auto publish the site, and I want to debug it on my local machine. I attached to w3wp.exe process, but isn't hitting. What process should I be attaching to? Is it not running in the same thread? THere is only one website on my machine, and no other app pool running...

Upvotes: 1

Views: 1579

Answers (2)

Mark Ursino
Mark Ursino

Reputation: 31435

By default with Visual Studio you cannot attach the debugger to Sitecore's Sitecore.Tasks.PublishAgent since its compiled into the Sitecore assembly. You can still do this with additional software:

You can use a disassembler that works with Visual Studio, such as .NET Reflector ($95) to decompile the assembly and generate the necessary *.pdb file to debug it. You can then attach the debugger to Sitecore.Tasks.PublishAgent's Run() method to see what happens.

Upvotes: 0

Matthew Dresser
Matthew Dresser

Reputation: 11442

As patrickmjones commented, a simple page is enough to test this. As long as its sitting under the website folder, you don't even need to have a Sitecore item for the page and it will still have a valid Sitecore context.

Create an aspx page with a runat server script block (no need for a code-behind) where you create an instance of your scheduled task class and call it's 'Run' method.

Upvotes: 2

Related Questions