简体   繁体   English

C# - MVC - 参考 class 库项目到主项目的问题

[英]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).目前我尝试做一个多层(业务层、数据访问层、实体层和主层)的 ASP.NET MVC 项目(.NET 4.5.2 框架)。

My business layer is a class library project.我的业务层是一个 class 库项目。 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. “业务层”项目以 .netstandard 2.0 为目标。 Can't references to .NETFramework Version =v4.5.2 project as target不能将 .NETFramework Version =v4.5.2 项目作为目标引用

This is a web.config section这是web.config部分

<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 .遇到的问题是由于版本支持不同,因为你试图将a.Net Standard 2.0库引用到.Net Framework 4.5.2 ,你可以参考下表,你需要升级你的项目.Net Framework 4.5.2.Net 框架 4.6.1

.Net 实施支持

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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