Joe
Joe

Reputation: 13091

Visual Studio 2017 - how to change .NET version of existing project?

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)?

Upvotes: 1

Views: 12300

Answers (2)

Chris
Chris

Reputation: 2304

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).

Upvotes: 1

Madhu
Madhu

Reputation: 439

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

Upvotes: 6

Related Questions