简体   繁体   English

如何在Visual Studio 2010中关闭远程调试?

[英]How to turn off remote debugging in Visual Studio 2010?

I got the project written in WPF + C# in VS2010 and when i start it by pressing F5 (but not Ctrl-F5, that works normal), the program itself starts lagging and task manager shows that in High Priority msvsmon.exe consumes almost all the CPU. 我在VS2010中用WPF + C#编写了项目,当我通过按F5启动它(但不是Ctrl-F5,这是正常的),程序本身开始滞后,任务管理器显示在高优先级msvsmon.exe消耗几乎所有CPU。 But it happens when i press buttons, type in textboxes and so on. 但是当我按下按钮,键入文本框等时会发生这种情况。

So how to turn it off? 那么如何关闭呢?

The remote debugger is also used in non-remote debugging scenarios. 远程调试器也用于非远程调试方案。 When your program runs in 64-bit mode for example. 例如,当程序以64位模式运行时。 VS is a 32-bit program, it uses the remote debugger to debug the program in that case. VS是一个32位程序,在这种情况下它使用远程调试器来调试程序。

You can avoid it by forcing your program to run in 32-bit mode. 您可以通过强制程序以32位模式运行来避免它。 Project + Properties, Compile tab, change the Platform target setting to x86. Project + Properties,Compile选项卡,将Platform目标设置更改为x86。 Also enables Edit and Continue, nice. 还可以启用编辑和继续,很好。

Seeing msvsmon.exe consuming so much cpu cycles is unhealthy of course. 看到msvsmon.exe消耗了如此多的cpu周期当然是不健康的。 Hard to guess what might cause it. 很难猜出可能导致它的原因。 Check for a storm of handled exceptions, you'll see their first-chance notification in the Output window. 检查处理异常的风暴,您将在“输出”窗口中看到他们的第一次机会通知。 Debug + Exceptions, tick the Thrown checkbox to make the debugger stop on them. Debug + Exceptions,勾选Thrown复选框以使调试器停在它们上面。 But that's just a guess. 但这只是猜测。

In your app or web.config file disable it! 在您的应用或web.config文件中禁用它!

  <system.diagnostics>
    <switches>
      <add name="Remote.Disable"
      value="1" />
    </switches>
  </system.diagnostics>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM