Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

How does msbuild resolve assembly from a multi-framework nuget package?

$
0
0

I have a solution with a console app ConsoleApp-net461 that references a library ClassLibrary-net452.

Both projects reference a multi-framework nuget package NuGetPackage-net452-net461.

When I build, I end up with the nuget package's net461 dll in the output folder. At runtime, I am getting errors like:

System.TypeLoadException: Inheritance security rules violated by type: 'ClassA'. 
Derived types must either match the security accessibility of the base type or be less accessible.

I am suspecting this is because my ClassLibrary-net452 ends up having a dependency on the nuget package dll with the net461 framework.

Is this normal behavior? What are the best ways to ensure the net452 dll is resolved from the nuget package? BindingRedirects don't seem to let you choose a target framework.


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>