NET standard 2.0 types and members are all packet in a single assemblies netstandard. dll v2. 0 that can be found under C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard. library\2.0.
Net Standard is a specification which dictates what the Base Class Libraries of different . Net platforms should implement to unify the Base Class Libraries of different . Net Platforms.
I think the solution might be this issue on GitHub:
Try add netstandard reference in web.config like this:"
<system.web> <compilation debug="true" targetFramework="4.7.1" > <assemblies> <add assembly="netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51"/> </assemblies> </compilation> <httpRuntime targetFramework="4.7.1" />
I realise you're using 4.6.1 but the choice of .NET 4.7.1 is significant as older Framework versions are not fully compatible with .NET Standard 2.0.
I know this from painful experience, when I introduced .NET Standard libraries I had a lot of issues with NUGET packages and references breaking. The other change you need to consider is upgrading to PackageReferences instead of package.config
files.
See this guide and you might also want a tool to help the upgrade. It does require a late VS 15.7 version though.
Manually editing the .csproj file and adding the reference below worked for me.
<Reference Include="netstandard" />
Thank you to Fahad Alshaya who suggested it here.
I had to do a combination of other people's answers on this thread.
<Reference Include="netstandard" />
Deleting Bin and Obj folders worked for me.
After upgrading from 4.6.1 framework to 4.7.2 we started getting this error:
"The type 'System.Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'." and ultimately the solution was to add the "netstandard" assembly reference mentioned above:
<compilation debug="true" targetFramework="4.7.1" >
<assemblies>
<add assembly="netstandard, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=cc7b13ffcd2ddd51"/>
</assemblies>
</compilation>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With