在 SharePoint 中调试自定义计时器作业
为了在 Visual Studio 中调试自定义计时器作业,我无法启动调试器。
是否有必要将 .PDB 文件添加到 GAC?
我尝试执行上述操作,但不允许拖放此特定文件。
为什么我们需要添加这个文件?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
拖放在程序集文件夹中不起作用,因为 shell windows 资源管理器附加到它。您可以执行 3 件事来绕过此 shell -
通过 cmd 将 .pdb 文件复制到 C:\windows\ assemblyGAC_MSIL\yourassemble\your assemblyversion\
使用gacutil.exe
将程序集文件夹映射为 Network-Drive \server\c$\windows\ assembly,然后像平常一样复制 .pdb
这里是一篇关于调试计时器作业的好文章。它是为 SP2007 编写的,但也应适用于 SP2010。
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 -
Copy the .pdb file via cmd in C:\windows\assemblyGAC_MSIL\yourassembly\yourassemblyversion\
Use gacutil.exe
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.
我总是编译到 bin 中,然后仅将 DLL 文件移动到 GAC(通常是手动),然后将调试器附加到 OWSTimer.exe 进程。工作得很好,只是在替换 GAC 中的文件后不要忘记重新启动服务。
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.