Reputation: 1151
I tried the following steps in order to debug a particular custom timer ( installed and activated):
.dll
and .pdb
files in the GAC.w3wp
and OWSTimer.exe
processes.But the debugging is still not taking place. The debugger placed is empty circle which displays this message:
The breakpoint will not currently be hit. No symbols have been loaded for this document.
The OWSTimer is shown in a diff username. Does It needs to be run from my account?
Why debugging is not working?
Upvotes: 2
Views: 12427
Reputation: 1
Upvotes: 0
Reputation: 1
Check to make sure your regional settings are correct - append /_layouts/15/regionalsetng.aspx
to the CA URL. If you have the wrong time zone, your job may be scheduled for a time in the past. This has hung me up more than once. If this is the case, set the correct time zone (using the url above), stop and start the timer service (either services tool or open command line - net stop sptimerv4
then net start sptimerv4
). Then attach to OWSTIMER and debug.
Upvotes: 0
Reputation: 21778
Debugging Timer Jobs can be hard... The steps you took sound about right, but you can also do some more:
iisreset
;-)If your breakpoints are still not hit, do something ugly: use Debugger.Launch()
or Debugger.Break()
in your code or an assertion which will always fails: System.Diagnostics.Trace.Assert(false);
And then there is MSDN for the rescue.
Upvotes: 14
Reputation: 39
Just adding to moontear's post.
I had the same loading debug symbols issue until I added in this code to the first line of my Execute method.
public override void Execute(Guid contentDbId)
{
// If in debug mode, trigger a false assertion to give time
// to attach the debugger to the OWSTIMER.EXE process.
#if (DEBUG)
System.Diagnostics.Trace.Assert(false);
#endif
...
Upvotes: 0
Reputation: 6988
Try loading debug symbols manually and see what it says:
To display the Modules window in break mode or in run mod
On the Debug menu, choose Windows, and then click Modules.
By default, the Modules window sorts modules by load order. However, you can choose to sort by any column.
In the Modules window, you can see which modules have debugging symbols loaded. This information appears in the Symbol Status column. If the status says Skipped loading Cannot find or open the PDB file, or Loading disabled by include/exclude setting, you can direct the debugger to download symbols from the Microsoft public symbol servers or to load symbols from a symbol directory on your computer. For more information, see How to: Use a Symbol Server and How to: Specify Symbol Locations and Loading Behavior.
To load symbols manually
In the Modules window, right-click a module for which symbols have not loaded.
Point to Load Symbols From and then click Microsoft Symbol Servers or Symbol Path.
copied from MSDN
You can also try to delete Visual Studio cache just to be sure (from command prompt):
del /Q %LOCALAPPDATA%\Microsoft\WebsiteCache
del /Q %LOCALAPPDATA%\Temp\VWDWebCache
del /Q %LOCALAPPDATA%\Microsoft\Team Foundation\1.0\Cache
Upvotes: 1