Why ServiceInstaller is not available in my "WPF App(.NET Framework)" projetct?

244 Views Asked by At

I would like to install and uninstall a windows service programmably, But i can not use ServiceInstaller in my "WPF App(.NET Framework)" project.

enter image description here

enter image description here

Did i miss some references?

1

There are 1 best solutions below

0
On BEST ANSWER

In a project that targets the .NET Framework, you should add a reference to System.ServiceProcess under Project->Add Reference->Assemblies->Framework.

The ServiceInstaller class is not available in .NET Core or .NET 5.