Use Environment.ProcessPath instead of GetCurrentProcess().MainModule.FileName
GetCurrentProcess().MainModule.FileName is expensive, Environment.ProcessPath added in net6
This commit is contained in:
parent
7521579bca
commit
f928ee7cad
|
@ -194,7 +194,6 @@ dotnet_diagnostic.CA1819.severity = suggestion
|
|||
dotnet_diagnostic.CA1822.severity = suggestion
|
||||
dotnet_diagnostic.CA1823.severity = suggestion
|
||||
dotnet_diagnostic.CA1824.severity = suggestion
|
||||
dotnet_diagnostic.CA1839.severity = suggestion
|
||||
dotnet_diagnostic.CA1840.severity = suggestion
|
||||
dotnet_diagnostic.CA1845.severity = suggestion
|
||||
dotnet_diagnostic.CA1846.severity = suggestion
|
||||
|
|
|
@ -64,7 +64,7 @@ namespace NzbDrone.Common
|
|||
|
||||
var args = $"create {serviceName} " +
|
||||
$"DisplayName= \"{serviceName}\" " +
|
||||
$"binpath= \"{Process.GetCurrentProcess().MainModule.FileName}\" " +
|
||||
$"binpath= \"{Environment.ProcessPath}\" " +
|
||||
"start= auto " +
|
||||
"depend= EventLog/Tcpip/http " +
|
||||
"obj= \"NT AUTHORITY\\LocalService\"";
|
||||
|
|
|
@ -46,7 +46,7 @@ namespace NzbDrone.Host
|
|||
try
|
||||
{
|
||||
Logger.Info("Starting Sonarr - {0} - Version {1}",
|
||||
Process.GetCurrentProcess().MainModule.FileName,
|
||||
Environment.ProcessPath,
|
||||
Assembly.GetExecutingAssembly().GetName().Version);
|
||||
|
||||
var startupContext = new StartupContext(args);
|
||||
|
|
Loading…
Reference in New Issue