6
votes

I tried to load a project I have and got this exception:

Severity Code Description Project File Line Suppression State Error The reference assemblies for framework ".NETFramework,Version=v4.6.1" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.

And each time I'm trying to reload the project while loading it I'm getting this window:

Error

I'm not sure what to download and where from.

And I can't change any of the project properties I'm getting error in all the properties windows.

3
Which Visual Studio version did you install? Which .NET SDK versions are installed on the machine? VS 2015 came with 4.6.1 since Service Pack 1. Visual Studio 2017 includes 4.7. Are you usinge a very old Visual Studio version perhaps?Panagiotis Kanavos
If you select the second option Visual Studio will download the correct SDK itself. If you use an old VS version like 2010 you should really really consider upgrading to a recent one - 2017 or 2019, which comes out today.Panagiotis Kanavos

3 Answers

18
votes

Either select "Download the targeting pack for..." from the dialog, or open the Visual Studio Installer, click "Modify" and select the 4.6.1 targeting pack from "Individual components":

enter image description here

6
votes

Windows -> Search -> Visual Studio Installer -> Modify -> Individual Components and check the right version

2
votes

Or you can directly download the targeting pack from Microsoft's website here: https://www.microsoft.com/en-us/download/details.aspx?id=49978

You can find all kind of SDKs for both .Net Framework as well as .Net Core on the Microsoft site: https://dotnet.microsoft.com/download/visual-studio-sdks