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.CA1822.severity = suggestion
|
||||||
dotnet_diagnostic.CA1823.severity = suggestion
|
dotnet_diagnostic.CA1823.severity = suggestion
|
||||||
dotnet_diagnostic.CA1824.severity = suggestion
|
dotnet_diagnostic.CA1824.severity = suggestion
|
||||||
dotnet_diagnostic.CA1839.severity = suggestion
|
|
||||||
dotnet_diagnostic.CA1840.severity = suggestion
|
dotnet_diagnostic.CA1840.severity = suggestion
|
||||||
dotnet_diagnostic.CA1845.severity = suggestion
|
dotnet_diagnostic.CA1845.severity = suggestion
|
||||||
dotnet_diagnostic.CA1846.severity = suggestion
|
dotnet_diagnostic.CA1846.severity = suggestion
|
||||||
|
|
|
@ -64,7 +64,7 @@ namespace NzbDrone.Common
|
||||||
|
|
||||||
var args = $"create {serviceName} " +
|
var args = $"create {serviceName} " +
|
||||||
$"DisplayName= \"{serviceName}\" " +
|
$"DisplayName= \"{serviceName}\" " +
|
||||||
$"binpath= \"{Process.GetCurrentProcess().MainModule.FileName}\" " +
|
$"binpath= \"{Environment.ProcessPath}\" " +
|
||||||
"start= auto " +
|
"start= auto " +
|
||||||
"depend= EventLog/Tcpip/http " +
|
"depend= EventLog/Tcpip/http " +
|
||||||
"obj= \"NT AUTHORITY\\LocalService\"";
|
"obj= \"NT AUTHORITY\\LocalService\"";
|
||||||
|
|
|
@ -46,7 +46,7 @@ namespace NzbDrone.Host
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Logger.Info("Starting Sonarr - {0} - Version {1}",
|
Logger.Info("Starting Sonarr - {0} - Version {1}",
|
||||||
Process.GetCurrentProcess().MainModule.FileName,
|
Environment.ProcessPath,
|
||||||
Assembly.GetExecutingAssembly().GetName().Version);
|
Assembly.GetExecutingAssembly().GetName().Version);
|
||||||
|
|
||||||
var startupContext = new StartupContext(args);
|
var startupContext = new StartupContext(args);
|
||||||
|
|
Loading…
Reference in New Issue