无法启动调试,因为调用的对象已与其客户端断开连接

我正在运行 Visual Studio 2012(版本11.0.61030.00 update 4)。在调试一个本地控制台应用时,当我开始调试时,我会得到以下错误(F5) :

---------------------------
Microsoft Visual Studio
---------------------------
Error while trying to run project: Unable to start debugging.
The object invoked has disconnected from its clients.
---------------------------
OK
---------------------------

只有当我离开视觉工作室几分钟而没有进行调试时才会发生这种情况。如果我关闭视觉工作室并重新打开错误消失(直到我离开它未触及另一对夫妇分钟)。有人经历过吗?我找不到任何其他人经历过的线索。

70420 次浏览

This may be a possible answer for the problem.

Some from the answer:

  1. Check which files were changed (why and how) after update from a source control engine
  2. Review the list of extensions and plugins. Try to disable all or some of them
  3. Close Visual Studio and kill all the development processes: devenv, mspdbsrv, vcpkgsrv, msbuild, msvsmon, vshub, vstest etc
  4. Remove .suo, .ncb, .VC.db, .VC.VC.opendb files of the solution as well as .vs directory, which sometimes cause problems
  5. Remove project setting files, sort of YourProjectName.vcproj.DOMAINNAME.LOGINNAME.user or YourProjectName.csproj.user. The setting file name depends on a project kind you use
  6. Run "C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" /setup or "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" /setup for x64 environment

Just Close the VIsual Studio and start again the project.Its work Perfectly for me. Thanks

I corrupted my App.config file with NLog settings without section Handler in the top of the document. Gist is check out your config file settings either corrupted in format or not properly handled any section. once I remove corrupted config section, it did not raise the error again (VS 2017) Hope it helps!

While restarting Visual Studio does provide a workaround, it doesn't solve the actual problem. In my case, I was working with a C# solution in VS2017 and the following resolved the issue:

  1. Close Visual Studio
  2. Delete the .vs folder that was created in the Solution's directory
  3. Re-open the Solution

In my case I have just reinstalled Windows 10 and so the Visual Studio 2022..

My project was targeting .net 5 SDK, but I only had .net 6 SDK installed. The solution was to install earlier version of the SDK.