简体   繁体   中英

C# - MVC - Issue with reference a class library project to main project

Currently I try to do an ASP.NET MVC project (.NET 4.5.2 framework) with multiple layers (business layer, data access layer, entities layer and main layer).

My business layer is a class library project. So when I try to references this project from the main layer, I get this error:

The project "Business Layer" has .netstandard 2.0 as target. Can't references to .NETFramework Version =v4.5.2 project as target

This is a web.config section

<configuration>
.
.
  <system.web>
    <compilation debug="true" targetFramework="4.5.2"/>
    <httpRuntime targetFramework="4.5.2"/>
  </system.web>

<\configuration>

Does someone know how to do this reference?

The problem encountered is due to the different version support because you are trying to reference a.Net Standard 2.0 library to .Net Framework 4.5.2 , you can refer to the table below, you need to upgrade your project .Net Framework 4.5.2 to .Net Framework 4.6.1 .

.Net 实施支持

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM