遠程調試監視器(MSVSMON.EXE)似乎沒有在遠程計算機上運行“的完美解決方案

原文出處:http://www.cnblogs.com/benbenkoala/p/5527257.html

By:行一山人Xingyihermit,Koala Studio,轉載請註明出處。


“遠程調試監視器(MSVSMON.EXE)似乎沒有在遠程計算機上運行“的完美解決方案

今天調試程序時,Visual Studio突然報出瞭如下錯誤:

Microsoft Visual Studio 遠程調試監視器(MSVSMON.EXE)似乎沒有在遠程計算機上運行。這可能是因爲防火牆阻止與遠程計算機通信。有關配置遠程調試的協助,請參閱幫助。

 

研究了半天,上網查找各種資料,怎麼說的都有,但沒有一個能真正解決此問題。筆者行一山人嘗試瞭如下方法:

1、重裝VS。本人使用的VS2015 Update1,新下的升級版,順便安裝升級到了VS2015 Update2,無效。

2、關閉防火牆,無效。

3、關閉安全軟件、殺毒軟件,無效。

4、將殺毒軟件一天內檢測到的隔離文件全部恢復到原位置,無效。

5、將MSVSMON.EXE所在文件夾的權限改爲everyone完全控制,無效。

6、修改登錄賬戶,賦予其Administrators權限,並從其它組中刪除,無效。

7、重啓系統、註銷用戶、重啓VS,無效。

好吧我實在是沒轍了,繼續查資料。

中外網站都看了,只發現了一個唯一可行的方案,就是把生成的目標平臺從Any CPU改爲x86,這個方法能讓調試啓動,但不完美。我想編譯64位的程序怎麼辦,還是得面對這個問題。

 

通過查看微軟的官方資料(https://msdn.microsoft.com/en-us/library/ms184681(v=vs.140).aspx),理解了爲什麼本地調試會報遠程調試錯誤。

Debug 64-Bit Applications

Visual Studio 2015
 

You can debug a 64-bit application that is running on the local computer or on a remote computer.

To debug a 64-bit application that is running on a remote computer, see Remote Debugging.

To debug 64-bit applications locally, Visual Studio uses a 64-bit worker process (msvsmon.exe) to perform the low-level operations that cannot be done inside of the 32-bit Visual Studio process.

Mixed-mode debugging is not supported for 64-bit processes that use .NET Framework version 3.5 or earlier.

Debug a 64-bit Application

To try debugging a 64-bit application:
  1. Create a Visual Studio solution, for example a C# console application.

  2. Set the configuration to 64-bit using the Configuration Manager. For more information, see How to: Configure Projects to Target Platforms.

  3. At this point the 64-bit version of the remote debugger (msvsmon.exe) starts. It runs as long as the solution with the 64-bit configuration is open.

  4. Start debugging. You should have the same experience as with a 32-bit configuration. If you get errors, see the Troubleshooting section below.

Troubleshooting 64-bit debugging

 

You may see an error: “A 64-bit debugging operation is taking longer than expected.” In this case, Visual Studio has sent a request to the 64-bit version of msvsmon.exe, and it has taken a long time for the result of that request to come back.

There are two main causes for this error:

  • You have networking security software installed on your computer that has caused the networking stack to be unreliable, and it has dropped packets going over localhost. Try disabling all network security software and see if this resolves it. If so, report to your network security software vendor that the software is interfering with localhost traffic.

  • You are running into a hang or performance problem with Visual Studio. If the problem happens regularly, you can collect dumps of Visual Studio (devenv.exe) and the worker process (msvsmon.exe) and send them to Microsoft. For information about reporting a problem, see How to Report a Problem with Visual Studio.

 

最終通過總結研究,終於找到了完美的解決方案,非常簡單:

1、查看Windows Firewall服務(或其它防火牆軟件)是否啓動,如果啓動則關閉。需要注意的是,有時防火牆服務會自動啓動,所以即使是設置爲手動模式,也要去確認一下。

2、刪除項目目錄下bin和obj兩個文件夾,然後重新生成項目。在重新生成時可能會提示引用的DLL錯誤,重新引用報錯的DLL後,再次生成即可。

這時發現項目又能正常調試啦!

 

有些問題確實奇怪,說難真難,但解決起來卻是如此簡單,特此隨筆以助有緣人吧。


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章