You must add a reference to assembly netstandard, Version=2.0.0.0
Hi, I have created new asp.net core application that's based on .NET Framework 4.6.1 and it doesn't build on my build server. Below is error message that I receive:
Error CS0012: The type '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'.
What should I do to solve that issue?
I have a 100% .net core 2.0 project, originally 1.1, and I'm getting something similar.
Error CS0012 The type 'DbConnection' 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'.
I just noticed that switching to 2.0 didn't upgrade the csproj, it looks like this,
<NetStandardImplicitPackageVersion>1.6.1</NetStandardImplicitPackageVersion>
Should I just change it there, or is there a way to do it in VS2017?
hi @rosieks
I have a similar problem, and I remove the RuntimeFrameworkVersion, and the problem was fixed.
Try to remove <RuntimeFrameworkVersion>1.1.1</RuntimeFrameworkVersion> or <NetStandardImplicitPackageVersion section in the csproj.
I have that problem for project that target version 2.0 from beginning.
@qqbuby - I didn't see your response, so I just replaced the old version with 2.0.0 and everything worked.
However, if what you said is true, maybe those sections are no longer needed, but if there, must target the correct version.
Either way, people upgrading will likely be confused because the process misses those things.
It looks like build server just lack Visual Studio 15.3
@qqbuby this didn't work for me, and I am still being asked to add a reference. Is anybody still experiencing this during upgrade?
Should we provide two versions, 1.0 and 2.0?
Best, Regards Roy Xu
On Aug 20, 2017, at 17:54, grokky1 [email protected] wrote:
I have the same problem. The upgrade guide does not cover this problem.
I am not using RuntimeFrameworkVersion or NetStandardImplicitPackageVersion. I hope someone from the dotnet team will address this problem.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
What is the solution for this? I'm getting it in lots of projects now. For example, https://github.com/Arch/UnitOfWork is supposed to work with netcore 20. When I clone and build that repo, it complains about references to System.Data and System.Text.RegularExpressions as well as DbConnection. ex:
Severity Code Description Project File Line Suppression State Error CS0012 The type 'DbConnection' 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'. Microsoft.EntityFrameworkCore.UnitOfWork C:\Users\redwards\Downloads\UnitOfWork-2.0.1\src\Microsoft.EntityFrameworkCore.UnitOfWork\UnitOfWork.cs 48 Active
Add System.Data to your reference. It solve my problem.
I had the same issue and when I upgraded VS2017 Enterprises IDE to version 15.5.5 it has been resolved magically.
this code worked for me
<ItemGroup>
<PackageReference Update="Microsoft.NETCore.App" Version="2.0.0" />
</ItemGroup>
I am still facing the same issue even after adding the
Any help ??
solution that worked for me "upgrading target framework to 4.7.1" with out changing any other configuration
I have created a new asp.net standard Library that is based on .NET Framework 4.6.2 and it doesn't build on my build server. Below is error message that I receive the same error:
You must add a reference to assembly netstandard
In my case the same issue was caused by xUnit - it turned out that xUnit requires .NET Core build tools. More details in this answer.
I having same issue while running uwp Xamarin project in windows emulator
Error CS0012 The type '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'.
you are targeting different version of dll In my case the error was
Error CS0012 The type 'Task<>' 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'. EboIotEdgeConnector.Extension D:\projects\EboIoTEdgeConnector-master\EboIotEdgeConnector.Extension\RetainedMqttMessageHandler.cs
I ) change the IMqttServerStorage to MQTTnet.Server.IMqttServerStorage 2) remove the reference and of net461 version and add the reference from \packages\MQTTnet.2.8.4\lib\netstandard2.0 Rebuild the solution the issue will be resolved
hi @rosieks
I have a similar problem, and I remove the
RuntimeFrameworkVersion, and the problem was fixed.Try to remove
<RuntimeFrameworkVersion>1.1.1</RuntimeFrameworkVersion>or<NetStandardImplicitPackageVersionsection in thecsproj.
Thanks
the same problem with teamcity build