Working with 2 Visual Studio 2015 instances : error CS2012 "file is being used by another process"

JYL*_*JYL 18 c# visual-studio-2015

With Visual Studio 2013, I used to open 2 instances of Visual Studio :

  • one for a "server" solution (say a WCF host),
  • one for a "client" solution (say a WPF app).

The 2 solutions have a common project, but this was not an issue : I could start the first in debug mode, start the second in debug mode, find a bug, stop one to fix the bug, and start it again (without stopping the second).

This scenario is no more possible with VS2015 : when I stop-fix-start one, I get a build error on the common project :

error CS2012: Cannot open 'D:\MyProject\obj\Debug\myCommonLib.dll' for writing -- 
'The process cannot access the file 'D:\MyProject\obj\Debug\myCommonLib.dll' because it is being used by another process.'
Run Code Online (Sandbox Code Playgroud)

有没有办法将此错误配置为visual studio 2015的"非阻塞"或返回vs2013行为?

编辑

Process explorer在启动客户端应用程序时显示此句柄:

  • 在VS2013上:

处理VS2013

  • 在VS2015上:

处理VS2015

==>我们可以在"obj"文件夹中显示dll上的另外2个句柄.这似乎是个问题.

Jua*_*anK 14

从VS为项目配置新的buid类型,需要将其配置为与调试模式相同.然后在"Debug"中运行其中一个,在"Debug 2"中运行另一个.

我希望这些图片指南可以帮到你.

转到菜单调试,然后选择配置管理器

创建新的构建配置

根据需要命名