declan.marks
declan.marks

Reputation: 91

Error when adding reference to class library in visual studio 2017

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.

Upvotes: 0

Views: 1088

Answers (1)

Lews Therin
Lews Therin

Reputation: 3777

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.

Upvotes: 1

Related Questions