c# - 如何停止在 C# 中运行 exe 以启动新实例?

标签 c# running-other-programs

我有一个用 C# 编写的服务器软件。有时我会犯这个错误:

Unable to copy file "obj\x86\Debug\Server.exe" to "bin\Debug\Server.exe". The process cannot access the file 'bin\Debug\Server.exe' because it is being used by another process.

我如何理解我的程序仍在后台运行并停止它?

最佳答案

这很可能不是由您的软件(您正在编写的软件)引起的,而是由 IDE 本身引起的。

我通常只是使用任务管理器来杀死任何仍在挂起的 vshost 进程,但这可能不是很安全。或者有时只需要重新启动 Visual Studio。

关于c# - 如何停止在 C# 中运行 exe 以启动新实例?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10137734/

相关文章:

c# - 在 C# 中使用 RSACryptoServiceProvider 查找公钥和私钥

c# - DataAnnotation 和可选的 DateTime 值

c# - 带有 GridSplitter 的 WPF 扩展器

c# - ASP.NET Web API Controller 最佳实践 - Action 定义

linux - 如何自动定时运行2个程序?

c++ - Windows是否有自己的 'call other .exe'函数(C++)

c# - 我可以修改传递的方法参数吗