Core.System.ServiceProcess
1.0.2
See the version list below for details.
dotnet add package Core.System.ServiceProcess --version 1.0.2
NuGet\Install-Package Core.System.ServiceProcess -Version 1.0.2
<PackageReference Include="Core.System.ServiceProcess" Version="1.0.2" />
paket add Core.System.ServiceProcess --version 1.0.2
#r "nuget: Core.System.ServiceProcess, 1.0.2"
// Install Core.System.ServiceProcess as a Cake Addin #addin nuget:?package=Core.System.ServiceProcess&version=1.0.2 // Install Core.System.ServiceProcess as a Cake Tool #tool nuget:?package=Core.System.ServiceProcess&version=1.0.2
Core.System.ServiceProcess
Support System.Configuration.Install for .NET Core / .NET 5+. Used version from Microsoft Reference Source and comments from .NET Framework DLL v4.0.0.0.
Usage / Documentation
Fixing the ImagePath in the Registry
Somewhere in your parent installer, you will need to correct the path for the ServiceInstaller
's assemblyPath
(non-case sensitive). With .NET Framework, the entry assembly was always an exe. However, even when running the exe dropped out with a publish, it just bootstraps the DLL and your ImagePath
gets written to the registry with a .dll
suffix, which will not work on startup (crashes in KERNELBASE.dll
).
Use something like this after whatever is setting your assemblyPath
today:
private void CorrectAssemblyPath(InstallContext context)
{
string possibleDll = context.Parameters["assemblyPath"];
if (possibleDll == null)
{
return;
}
if (possibleDll.EndsWith(".dll", StringComparison.OrdinalIgnoreCase))
{
var exe = possibleDll.Substring(0, possibleDll.Length - 4) + ".exe";
context.Parameters["assemblyPath"] = exe;
}
}
Assembly Filename
The assembly had to be renamed to System.ServiceProcess.Core.dll
because the .NET Core pack comes with an empty (based on analysis with dnSpy) System.ServiceProcess.dll
which causes the build to fail by saying none of the types are valid (assembly not referenced error). The compiler does not complain about the two DLLs and just silently ignores the new one.
I renamed it, but all the types are still in the original namespace so this should not affect your code.
More documentation would be appreciated via PRs, but this library is only for backward compatibility with .NET Framework applications being brought into .NET Core and .NET 5+, so it should not be used for new projects.
The interactive service credential prompt is only available when targeting .NET Core 3.0+ since System.Windows.Forms
is unavailable in .NET Standard 2.0. This functionality is untested (by me).
Installation
dotnet add package Core.System.ServiceProcess
License
This software is distributed under the terms of the MIT License (MIT).
Authors
Chris Benard / LinkedIn
Special Thanks
Thank you to @flamencist for his encouragement and work on Core.System.Configuration.Install. This project was patterned after his and relies upon it (it is a package reference).
Contributing
Contributions and bugs reports are welcome.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 is compatible. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETCoreApp 3.0
- Core.System.Configuration.Install (>= 1.1.0)
- System.Diagnostics.EventLog (>= 4.7.0)
- System.Security.Permissions (>= 4.7.0)
- System.ServiceProcess.ServiceController (>= 4.7.0)
-
.NETStandard 2.0
- Core.System.Configuration.Install (>= 1.1.0)
- System.Diagnostics.EventLog (>= 4.7.0)
- System.Security.Permissions (>= 4.7.0)
- System.ServiceProcess.ServiceController (>= 4.7.0)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on Core.System.ServiceProcess:
Package | Downloads |
---|---|
AACOptics.Net.Utilities
net utilities |
|
KurtsTools
Directory Tools - NewTempDirectory - DeleteDirectory - DirectoryStructureIsEqual - DirectoryIsEqualRecursive - CopyDirectory - BuildDirectoryStructure File Tools - GetMd5Hash - GetConfig Photo Tools - ExifToolWrapper String extensions - FirstWord - SecondWord - FirstWordAndRest - SecondWordAndRest - TrimFirstWord Windows - IsAdministrator - GetServiceControllerByNameOrDisplayName - StopAndDeleteService - CmdRun - ArgumentAnalyzer |
|
XuanYuan.Net.Utilities
net utilities |
|
TryIT.WindowService
Provide method to operate window service, Start, Stop, Restart |
|
Net.Utilities
net utilities |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on Core.System.ServiceProcess:
Repository | Stars |
---|---|
yar229/WebDavMailRuCloud
WebDAV cloud.mail.ru ...& Yandex.Disk | WebDAV Облако Mail.Ru Сетевой Диск
|