Debugging a custom timer job in SharePoint

江枫思渺然 提交于 2019-12-12 16:40:29

问题


To debug a custom timer job in visual studio, I wasn't able to hit the debugger.

Is it necessary to add the .PDB file to GAC?

I tried doing the above, but it's not allowing to drag and drop this particular file.

Why do we need to add this file?


回答1:


Drag and drop does not work in the assembly folder because of the shell windows explorer attaches to it. You can do 3 things to bypass this shell -

  1. Copy the .pdb file via cmd in C:\windows\assemblyGAC_MSIL\yourassembly\yourassemblyversion\

  2. Use gacutil.exe

  3. Map the assembly folder as Network-Drive \server\c$\windows\assembly and then copy the .pdb just as you normally would

Here is a good article about debugging timer jobs. It's written for SP2007 but should apply to SP2010 aswell.




回答2:


I always compile into bin, then move the DLL file only to the GAC (usually manually) and then attach the debugger to OWSTimer.exe process. Works just fine, just don't forget to restart the service after replacing the file in the GAC.



来源:https://stackoverflow.com/questions/7470154/debugging-a-custom-timer-job-in-sharepoint

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!