断点为实心红色,但从未命中.调用Debugger.Launch()要求在新的VS2019窗口中以管理员身份运行实时调试器



昨天我像往常一样调试了一个项目。我在要进入代码的行上放了一个断点。我运行了解决方案,并做了一些本应触发断点的事情。但什么也没发生。它只是跳过代码。

所以我在我想中断的行之前调用了System.Diagnostics.Degger.Launch((。现在,当我运行代码并触发函数时,会弹出一个窗口,上面写着:

实时调试器在没有必要的安全权限的情况下启动。若要调试此进程,必须以管理员身份运行实时调试器。是否要调试此进程?

对此我表示同意。但随后它会在另一个窗口中打开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

问题出现在web应用程序项目设置中。它应该设置为使用本地IIS,并具有我指定的url,该url与我的计算机上运行在IIS中的网站相匹配。不知怎么的,它被切换到IIS Express并使用了localhost:port#url。由于它与我的IIS设置不匹配,所以它没有被路由到我的调试进程。我不知道这个设置会如何改变。自去年以来,我甚至没有看过它,也没有人在版本控制中更改过文件。

最新更新