1

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?

2
  • Where did you get the web config file from? Is that the one for the project your trying to add reference to or the one your adding ? It sounds like the business layer project is set to a different version of .net framework and you need to go into the project settings and change to same version as other project Commented Feb 7, 2021 at 0:45
  • 2
    I am pretty sure that you have created your business library using the .net core library template instead of the .net framework one. The easiest thing to do, is to create a new library using the .net framework template, and then copy your source files into the new project. Commented Feb 7, 2021 at 8:09

1 Answer 1

1

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 implementation support

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.