user3747994
user3747994

Reputation: 129

Project 'net5.csproj' targets 'net5.0'. It cannot be referenced by a project that targets '.NETFramework,Version=v4.6.1'

I am trying to reference .net5 class library to .net framework 4.6.1 project, Can .net 5.0 is capable of referencing the class library to .net framework 4.6.1 project

Upvotes: 5

Views: 15828

Answers (3)

BimmerM3
BimmerM3

Reputation: 399

I had this problem and the issue was that I selected "Class Library" instead of "Class Library (.Net Framework)" when creating the project.

Upvotes: 0

SummerCode
SummerCode

Reputation: 1403

In my particular case, I needed to repair the .Net SDK. Once computer restarted afterwards, it worked.

Upvotes: 0

Brian Booth
Brian Booth

Reputation: 757

In my experience, the behavior you are seeing has been normal for many years. For example, a 4.5 project cannot reference a 4.6 project. If you change your 4.6.1 project to 5.0, however, I would predict it will compile just fine without any problems.

Upvotes: 4

Related Questions