1

I just installed new VS and opened existing project.

It is showing error:

"The C# project "..." is targeting ".NETFramework,Version 4.7" which is not installed on this machine...

But I just installed new VS (November 2018) and pretty sure it comes with newer .NET.

What configuration settings I should change to make this work (open existing project with correct .NET version)?

5
  • 1
    Project properties. Commented Nov 20, 2018 at 18:31
  • You either install the proper framework SDK (as the error makes it clear that's not installed) or use an earlier framework. Commented Nov 20, 2018 at 18:32
  • From VS Installer you need to install the .NetFramework Version 4.7/4.x. Commented Nov 20, 2018 at 18:32
  • 1
    The VS2017 installer provides the 4.6.1 reference assemblies by default. The most widely available version. To get 4.7.x you need to go back to the installer and select it. Commented Nov 20, 2018 at 18:41
  • One thing you want to do is make sure that the framework you target is supported on your devs' machines, on the build server, and on whatever deployment target your application will be deployed to. You also want to make sure that the C# version your devs have matches the compiler version on your build machine (otherwise you will get 'scratch your head' build errors). Commented Nov 20, 2018 at 18:45

2 Answers 2

6

Right click on project, Properties --> Application --> Target framework. Target framework dropdown displays list of frameworks installed on your machine.

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

Comments

1

It's not enough to install the latest version of Visual Studio; you need to ensure that you're actually installing the version of .NET Framework you want. It won't install all of them by default.

  1. Re-run your Visual Studio 2017 installer.
  2. It should detect that you already have Visual Studio 2017 installed, and click Modify.
  3. After that, click on the box that says .NET Desktop Development (note, don't uncheck the box -- simply click the box itself). On the right pane, you should see some optional components. If you see .NET Framework 4.7 development tools unchecked, that means it is currently not installed and you need to check that box and anything else additional that you need, and install it.

Conversely, you can also go to the Individual Components section and find the .NET Framework 4.7 SDK/Targeting Pack components and install them from there as well (they should be at the top of the list).

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.