-1

.NET Core/Standard 2.0 now lets you reference old .NET Framework libraries. You can install them via NuGet, and the code will build. This works within limits though:

"The supported scenario is referencing a .NET Framework library that happens to only use types within the .NET Standard API set." -- Announcing .NET Core 2.0

When using Topshelf from a .NET Core 2.0 application, I get the following exception:

enter image description here

There seems to be a dependency on System.ServiceProcess.ServiceAccount that is not satisfied. Is this dependency available within the .NET Standard 2.0 spec at all? If not, is there any other way I can get this to work?

Gigi
  • 28,163
  • 29
  • 106
  • 188

1 Answers1

3

TopShelf does not work on .NET Core 2.0 because it is missing some other fundamental APIs as well (most prominent one would be ServiceBase). Some missing types are being developed as NuGet packages for the 2.1 timeframe but this does not mean that TopShelf is instantly going to work. You can follow TopShelf's GitHub issue for .NET Core support for details and updates and even some replacement libraries for basic functionality if you must run on .NET Core until TopShelf will be able to work on .NET Core (basis of which I have written).

Martin Ullrich
  • 94,744
  • 25
  • 252
  • 217