(Note, this question has been marked answered in Debugging Sharepoint timer jobs but I’m still having trouble)
I’m unable to debug my SharePoint timer job. Usually I can do this by setting one of these:
Debugger.Launch()Trace.Assert(false)
But a dialog is not shown. I have a log4net OutputDebugStringAppender so that I can use DebugView to monitor output, and I can see that DEBUG ASSERTION FAILED is being written to the debug log. I’ve tried removing the appender in case it might mess up something, but with no luck.
(Rebuild, restart, IIS reset, Service reset, pdb files in assembly is done)
So why is a dialog not shown? I could really use some help with debugging this timer job and would be very thankful for any ideas.
You are most probably running your app in Debug mode instead of Release mode. In debug mode you already have Debugger attached so it won’t launch.
You can find if debugger is attached or not by this:
So try like this: