Severity Code Description Project File Line Suppression status Error CS0012 Type "Object" is defined in an unreferenced assembly. A reference to the assembly "mscorlib, version=4.0.0.0, culture=neutral, PublicKeyToken=b77a5c561934e089" must be added. XXX C:\project\my\xxx.cs 24 active Problems encountered when developing .NET Core projects
Project A is a .NETCoreApp version 1.1 project, and Project B is a .NET 4.5 project
When item A refers to item B, the error reported is as above.
Solution:
nuget installs the package as follows:
Introduction
Implementation and targeting. NET Framework 4.0 and compatibility with portable libraries from earlier .NET versions such as Silverlight. This package supports redirecting references to classic reference assemblies (mscorlib.dll, system.dll, etc.) to new contract assemblies (System.Runtime.dll, System.IO, etc.). It does this for a fee to prevent using assemblies from having to reference all contracts that happen to overlap with mscorlib. Therefore, you may encounter similar errors while using this package Error CS0012: Type "WebRequest" is defined in an unreferenced assembly. You must add a support to the assembly 'System. Net.Requests, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. To fix these errors, install the package with the same name as the missing assembly. TFS ID:1612576,GitHub SHA:https://github.com/dotnet/corefx/tree/f47c814b003d17da52940739e227f04e52b10279 When using NuGet 3.x, this package requires at least version 3.4.
Requires NuGet 2.12 or later.
|