.net-core - 为什么 dotnet 运行启动 2 个进程?

标签 .net-core dotnet-cli

当我从我的 PowerShell 运行我的 dotnet core 2 应用程序时,我总是看到启动了 2 个进程。 这很烦人,因为在 Visual Studio 2017 中我无法“重新附加”调试器,因为总是有 2 个同名“dotnet”的进程。

enter image description here

有什么办法可以改变吗?

最佳答案

dotnet run 是一个开发命令,用于构建项目并查询项目以获取要运行的实际命令。然后它会启动程序中描述的程序 - 可能是 dotnet some.dllsomeapp.exe,具体取决于程序类型。

要解决您的问题,请运行如下命令

dotnet bin\Debug\netcoreapp2.0\mapp.dll

直接避免过程噪音。

您还可以在它之前链接一个构建命令,这样您就可以根据更改重建项目,并且仍然有运行 msbuild 的进程终止:

dotnet build; dotnet bin\Debug\netcoreapp2.0\mapp.dll

关于.net-core - 为什么 dotnet 运行启动 2 个进程?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48595404/

相关文章:

c# - Entity Framework Core 2.2 使用标量 DBFunction 获取外键列表中的属性

c# - Azure 应用程序配置未加载 key

.net-core - dotnetcore 和 kestrel 出现 Nancy 500 服务器错误

windows - dotnet 未被识别为 cmdlet 的名称

linux - 如何在 MSBuild 中获取当前操作系统?

c# - 同时启动多个长时间运行的后台服务

.net-core - Dotnet 还原错误 "error NU3004: The package is not signed."

.net - DOTNET1011 : Framework not installed: . NETFramework

asp.net - 在 .NET Framework 中引用库,而不是在 .NET Standard 中

c# - 如何使用 dotnet-cli 将新的 c# 文件添加到项目中