【发布时间】:2018-04-24 19:00:52
【问题描述】:
我正在尝试使用 Octopus Deploy 为我的 .Net Core 控制台应用程序设置部署。我最初的想法是在启动新版本之前按名称杀死旧版本的进程,但问题是所有 .Net Core 进程都称为“dotnet”......有没有办法通过名称杀死 .Net Core 进程dll?
【问题讨论】:
我正在尝试使用 Octopus Deploy 为我的 .Net Core 控制台应用程序设置部署。我最初的想法是在启动新版本之前按名称杀死旧版本的进程,但问题是所有 .Net Core 进程都称为“dotnet”......有没有办法通过名称杀死 .Net Core 进程dll?
【问题讨论】:
使用PowerShell:
$process = Get-Process | where {$_.Name -eq 'dotnet' -and $_.modules.ModuleName -eq 'test.dll'}
if ($process) {
$process | Stop-Process -Force
}
【讨论】: