Your project does not reference “.NETFramework,Version=v4.6.2” framework. Add a reference to “.NETFramework,Version=v4.6.2” in the “TargetFrameworks”

I can’t run my unit tests.

I have the next error:

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

In app.config:

<startup>
  <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
</startup>

In Project > Properties > Application > TargetFramework (.NET Framework 4.6.2)

How can I fix it?

13 Answers
13

Leave a Comment