dotnet / docs

This repository contains .NET Documentation.
https://learn.microsoft.com/dotnet
Creative Commons Attribution 4.0 International
4.28k stars 5.91k forks source link

.NET Framework Windows Service fails to install if referencing a .NET Standard class library (project or DLL) #21735

Open ophilbinbriscoe opened 3 years ago

ophilbinbriscoe commented 3 years ago

Good morning/afternoon/evening,

I have code in a .NET Standard class library that I need to use in a Windows Service service project. My service builds, install, and runs correctly, until I add a reference to that class library. If I wrap the class library in a .NET Framework class library and reference the latter, I am able to install the service and access the (wrapped) API. I'd prefer not to maintain a wrapper or incur the performance overhead of another layer of indirection.

Is this by design? Is this another instance of a new .NET dev not understanding compatibility in .NET hell? (excuse my French)

Here's a visual aid for the issue I'm running into:

.NET Framework Windows Service (installs & runs) vs .NET Standard class library -> .NET Framework Windows Service (won't install) vs .NET Standard class library -> .NET Framework class library -> .NET Framework Windows Service (installs & runs)

I appreciate any input anyone might have on this particular case.

Thank you,

Oliver

gewarren commented 3 years ago

@ophilbinbriscoe It might be better to ask your question here on the new Q&A site for .NET: https://docs.microsoft.com/en-us/answers/products/dotnet.