12

I had not seen this before, but when opening a project that worked fine on a coworkers machine I saw this...

error : Your project does not reference ".NETFramework,Version=v4.7.1" framework. Add a reference to ".NETFramework,Version=v4.7.1" in the "TargetFrameworks" property of your project file and then re-run NuGet restore.

The project targeted .net 4.71 and it had NuGet references like

<package id="log4net" version="2.0.8" targetFramework="net471" />

This is using the packages.config version of NuGet references (not the newer project based NuGet references in VS 15.9)

Visual Studio Version: 15.9

What is the cause and how to fix?

2 Answers 2

27

I had the same problem. Deleting the \bin and \obj folder in the project folder resolved this issue.

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

1 Comment

We have two csproj, one for net core and one for net 471. We use different obj/bin folders to avoid this error.
0

I didn't find the cause, but when I converted the NuGet packages.config to package references it resolved the issue.

Looks this this is the same issue.

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.