在VS2012 c#项目的构建过程中,我一直得到这个错误
Error 41 Could not copy "obj\Debug\WeinGartner.WeinCad.exe" to
"bin\Debug\WeinGartner.WeinCad.exe".
Exceeded retry count of 10. Failed.
Error 42 Unable to copy file "obj\Debug\WeinGartner.WeinCad.exe" to
"bin\Debug\WeinGartner.WeinCad.exe". The process cannot access the file
'bin\Debug\WeinGartner.WeinCad.exe' because it is being used by another
process.
现在我知道该终止进程了
Weingartner.WeinCad.vhost.exe
(有时)有用,但这让我很紧张。有办法阻止这一切发生吗?
调试器设置为
这是因为你已经关闭了你的应用程序,但它仍然在后台运行。
临时解决方案:
进入任务管理器(Ctrl + Shift + Esc)。
进入进程选项卡,找到“YourProjectName.exe”。
如果找不到自己的进程,请勾选“显示来自所有用户的进程”。
结束处理
永久解决方案:必须通过编码关闭应用程序。这是代码…
System.Windows.Forms.Application.Exit();
您必须以所有形式将此代码放入表单的关闭事件中。例子:
private void frm_menu_FormClosing(object sender, FormClosingEventArgs e)
{
System.Windows.Forms.Application.Exit();
}
这是因为你已经关闭了你的应用程序,但它仍然在后台运行。
临时解决方案:
进入任务管理器(Ctrl + Shift + Esc)。
进入进程选项卡,找到“YourProjectName.exe”。
如果找不到自己的进程,请勾选“显示来自所有用户的进程”。
结束处理
永久解决方案:必须通过编码关闭应用程序。这是代码…
System.Windows.Forms.Application.Exit();
您必须以所有形式将此代码放入表单的关闭事件中。例子:
private void frm_menu_FormClosing(object sender, FormClosingEventArgs e)
{
System.Windows.Forms.Application.Exit();
}