0

I have created a class library to a current solution in visual studio 2017 and I have added a reference to it in my main application.

But when I build I get this error

Severity Code Description Project File Line Suppression State Error Project 'C:\Users\declanmarks\Documents\oversurgeryassignment\OverSurgeryAssignment\Utility\Utility.csproj' targets '.NETStandard,Version=v2.0'. It cannot be referenced by a project that targets '.NETFramework,Version=v4.5.2'. OverSurgeryAssignment

I cannot figure out how to fix this.

3
  • 2
    You need to change your target frameworks to be compatible. Commented Nov 15, 2017 at 21:13
  • What target frameworks are compatible. Commented Nov 15, 2017 at 21:17
  • 1
    github.com/dotnet/standard/blob/master/docs/versions.md. For .NET Standard 2.0 you need .NET Framework 4.6.1 or higher. Commented Nov 15, 2017 at 21:22

1 Answer 1

1

Make sure the Target framework version of the project that is referencing the class library matches the version in the class library.

You can get to the Target framework option by right-clicking the project in the solution explorer and clicking on Properties. The Target framework option is on the Application tab of the project properties window.

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.