【发布时间】:2020-08-05 03:43:41
【问题描述】:
昨天我像往常一样去调试一个项目。我在我想进入代码的行上放了一个断点。我运行了解决方案并做了一些应该触发断点的事情。但什么也没有发生。它只是跳过代码。
所以我在我想中断的行之前调用了 System.Diagnostics.Debugger.Launch()。现在,当我运行代码并触发函数时,会弹出一个窗口,上面写着:
即时调试器在没有必要的安全权限的情况下启动。要调试此过程,Just-In-Time 调试器必须以管理员身份运行。要调试这个进程吗?
我说是的。但随后它会在另一个窗口中打开 Visual Studio 并开始调试 w3wp.exe 进程。我可以单步调试一些代码,但不能单步调试所有代码,这不是很有用,因为我无法找到我真正想要调试的代码。
- 我以管理员身份运行 VS2019。不知道为什么它要求我以管理员身份运行 JIT。
- 我检查了我的 Global.asax 文件,没有任何东西会关闭调试器。
- 我检查了事件查看器,看看它是否能告诉我一些关于 JIT 调试器在附加之前被其他进程关闭的信息。但什么也没找到。
- IISReset 没有修复它。
- 我正在使用带有云服务的 Azure 托管 Web 应用程序。
编辑:我在事件日志中找到了这个:
The description for Event ID 1015 from source Windows Azure Runtime 2.7.0.0 cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.
If the event originated on another computer, the display information had to be saved with the event.
The following information was included with the event:
1860
iisexpress
Role environment . FAILED TO INITIALIZE. hr: -2147467259
The message resource is present but the message was not found in the message table
【问题讨论】:
-
你的项目框架版本是多少?请尝试将您的框架版本定位到
net472或重新启动您的电脑以测试问题是否仍然存在。此外,您可以尝试参考this similar issue。请让我们知道它是否有帮助。 -
项目框架为4.7.2。按照链接的 SO 问题中的步骤没有解决我的问题。
-
删除或重命名
c:\windows\system32\vsjitdebugger.exe。然后仔细检查你的global.asax文件,确保上面没有异常。 -
重命名 jit 调试器不起作用。没有任何 global.asax 文件问题。我的同事可以使用相同的文件进行调试。
-
@toshiomagic,请尝试通过
Tools-->Import and Export Settings-->Reset all settings重置vs设置。 2)禁用Extensions-->Manage Extensions下的任何第三方扩展。
标签: visual-studio debugging visual-studio-2019