无法在 sharepoint 中调试自定义计时器作业
我尝试了以下步骤来调试特定的自定义计时器(已安装并激活):
- 复制了 GAC 中的
.dll
和.pdb
文件。 - 重新启动计时器服务。
- 附加了
w3wp
和OWSTimer.exe
进程。
但调试仍然没有进行。放置的调试器是空圆圈,显示以下消息:
<块引用>当前不会命中断点。该文档尚未加载任何符号。
OWSTimer 显示在不同的用户名中。它需要从我的帐户运行吗?
为什么调试不起作用?
I tried the following steps in order to debug a particular custom timer ( installed and activated):
- Copied the both
.dll
and.pdb
files in the GAC. - Restarted the timer services.
- Attached both
w3wp
andOWSTimer.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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
调试计时器作业可能很困难...您采取的步骤听起来不错,但您还可以执行更多操作:
iisreset
;-)如果您的断点仍未命中,请执行一些难看的操作:使用
Debugger.Launch()
或代码中的 Debugger.Break()
或始终失败的断言:System.Diagnostics.Trace.Assert(false);
然后是 MSDN 来救援。
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()
orDebugger.Break()
in your code or an assertion which will always fails:System.Diagnostics.Trace.Assert(false);
And then there is MSDN for the rescue.
尝试手动加载调试符号并查看其内容:
复制自 MSDN
您也可以尝试删除 Visual Studio 缓存,以便确定(从命令提示符):
Try loading debug symbols manually and see what it says:
copied from MSDN
You can also try to delete Visual Studio cache just to be sure (from command prompt):
只是添加到 Moontear 的帖子中。
我遇到了相同的加载调试符号问题,直到我将此代码添加到 Execute 方法的第一行。
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.
检查并确保您的区域设置正确 - 将
/_layouts/15/regionalsetng.aspx
附加到 CA URL。如果您的时区错误,您的工作可能会被安排在过去的时间。这已经让我不止一次挂断了。如果是这种情况,请设置正确的时区(使用上面的 url),停止并启动计时器服务(服务工具或打开命令行 -net stop sptimerv4
然后net start sptimerv4 )。然后连接到 OWSTIMER 并进行调试。
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
thennet start sptimerv4
). Then attach to OWSTIMER and debug.