Another popular error is the referring of packages which does not satisfy all framework on the global scope when multiple frameworks are targeted.
{
"version": "1.0.0-*",
"dependencies": {
"NETStandard.Library": "1.6.0",
"Microsoft.AspNet.Identity.EntityFramework": "2.2.1"
},
"frameworks": {
"netstandard1.3": { },
"net451": { }
}
}
The (meta) library NETStandard.Library
works fine in this example, since it targets
both netstandard1.3
and net451
. However the library
Microsoft.AspNet.Identity.EntityFramework
does only target the .NET Framework net
and mscorlib
and therefore cannot be used for a netstandard
output.
Either search for a library (version) which cover both frameworks or add the library in the conditional dependencies below the framework.
{
"version": "1.0.0-*",
"dependencies": {
"NETStandard.Library": "1.6.0"
},
"frameworks": {
"netstandard1.3": { },
"net451": {
"dependencies": {
"Microsoft.AspNet.Identity.EntityFramework": "2.2.1",
}
}
}
}
In this case, the library can only be used in conditional #ifdef blocks for the net451
build.