This article is a mirror article of machine translation, please click here to jump to the original article.

View: 23410|Reply: 1

[.NET Core] The type "Object" is defined in an unreferenced assembly. Must add a response to the program...

[Copy link]
Posted on 7/3/2018 5:27:34 PM | | | |
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.





Previous:Javascrip{filter}t gets page and screen size parameters
Next:GET request "HTTP Error 400. The request URL is invalid"
Posted on 7/4/2018 8:54:36 PM |
11111
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com