Simon Cropp
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
10 additions and
3 deletions
-
src/Microsoft.Tye.Core/ProcessUtil.cs
-
src/Microsoft.Tye.Hosting/ProcessRunner.cs
|
|
|
@ -144,7 +144,8 @@ namespace Microsoft.Tye |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
Process.GetProcessById(pid)?.Kill(); |
|
|
|
using var process = Process.GetProcessById(pid); |
|
|
|
process?.Kill(); |
|
|
|
} |
|
|
|
catch (ArgumentException) { } |
|
|
|
catch (InvalidOperationException) { } |
|
|
|
|
|
|
|
@ -332,8 +332,8 @@ namespace Microsoft.Tye.Hosting |
|
|
|
|
|
|
|
private static string? GetDotnetRoot() |
|
|
|
{ |
|
|
|
var process = Process.GetCurrentProcess(); |
|
|
|
var entryPointFilePath = process.MainModule.FileName; |
|
|
|
var entryPointFilePath = GetEntryPointFilePath(); |
|
|
|
|
|
|
|
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && |
|
|
|
Path.GetFileNameWithoutExtension(entryPointFilePath) == "dotnet") |
|
|
|
{ |
|
|
|
@ -347,6 +347,12 @@ namespace Microsoft.Tye.Hosting |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
private static string GetEntryPointFilePath() |
|
|
|
{ |
|
|
|
using var process = Process.GetCurrentProcess(); |
|
|
|
return process.MainModule.FileName; |
|
|
|
} |
|
|
|
|
|
|
|
private class ProcessInfo |
|
|
|
{ |
|
|
|
|
|
|
|
|