You must add a reference to assembly 'netstandard, Version=2.0.0.0
Deleting Bin and Obj folders worked for me.
I had to do a combination of other people's answers on this thread.
- Install the NetStandard.Library via NuGet
- Manually editing the .csproj file and adding the reference.
<Reference Include="netstandard" />
- Expanding project-->References in the VS Solution Explorer, right clicking on 'netstandard' and showing the properties page and setting "Copy Local" to true.
Manually editing the .csproj file and adding the reference below worked for me.
<ItemGroup>
<Reference Include="netstandard" />
</ItemGroup>
Thank you to Fahad Alshaya who suggested it here.
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.