Why aren't reference assemblies resolved from the GAC when running on full .NET Framework?
See original GitHub issueI have a self-hosted (in a Windows Service) ASP.NET Core website running on full .NET Framework 4.6.1. When it is published and deployed to a machine that doesn’t have the reference assemblies (i.e. C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1
doesn’t exist) the website responds with:
InvalidOperationException: Can not find reference assembly ‘.NETFramework/v4.6.1/Microsoft.CSharp.dll’ file for package Microsoft.CSharp
My understanding is that these reference assemblies are only for design-time/compile-time support and are installed by tooling (SDKs/Visual Studio) and not by the .NET Framework itself. The publish target has .NET Framework 4.6.1 but doesn’t have the reference assemblies. If I copy the reference assemblies from my development machine to the publish target, everything works.
Is this a bug? Shouldn’t it be trying to resolve the assembly from the GAC?
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (2 by maintainers)
Top GitHub Comments
It can go in any top level property group, for example:
(it doesn’t have to have its own group though)
Allan, thanks for this tip. Given the structure of the new VS2017 .NET CSProj files, where in the project file tree should the
<BuildForIIS>true</BuildForIIS>
go?