Rider Project ‘something.csproj’ targets ‘NET_4_6’. It cannot be referenced by a project that targets ‘.NETFramework,Version=v4.0’

Got this error while setting up my new working environment.

For some reason I skipped Mono and .NET installations while installing and configuring Rider. This seems to have caused some misconfiguration in Rider. So the solution for me (Mac) was simple:

  • Open Rider
  • Go to “Preferences/Build, Execution, Deployment”
  • Then “Toolset and Build”

You might notice on the right, that MSBuild – which is basically the build tool responsible for getting things done in Rider – is set to a lower version. For instance, mine was set to “15” coming from Mono’s installation folder, while I had “17” available from my .NET installation folder. Selecting .NET’s 17 version did the trick, no more errors in Rider’s “Problems” tab.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.