title: error MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.5" were not found
body: <p>I have recently upgraded my Visual Studio environment, and now I seem to have a problem with my .Net framework, as you can see in following error message:</p>
  
  <blockquote>
    <p>9>    C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1126,5): error MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.5" 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.</p>
  </blockquote>
  
  <p>(the number "9" is just a counter of the nineth project within my Visual Studio solution)</p>
  
  <p>Let me explain you what's so confusing about this situation:</p>
  
  <p>When I load my solution, I get following error message:</p>
  
  <blockquote>
    <p>The C# project ... is targeting ".NETFramework,Version=4.5", which is not installed on this machine. To proceed, select an option below:</p>
  </blockquote>
  
  <ul>
  <li>Change the target to .NET Framework 4.6.1. You can change back to ".NETFramework,Version=4.5" at a later time.</li>
  <li>Download the targeting pack for ".NETFramework,Version=4.5". The project will not change.</li>
  <li>Do not load the project.</li>
  </ul>
  
  <p>I choose for the second option, and I get following website: <a href="https://www.microsoft.com/net/download/visual-studio-sdks" rel="noreferrer">.NET SDKs for Visual Studio</a></p>
  
  <p>This gives the following: list of .NET Frameworks:</p>
  
  <pre><code>4.7.1   Developer Pack, included in Visual Studio 2017   Runtime   Release Details
  4.7     Developer Pack, included in Visual Studio 2017   Runtime   Release Details
  4.6.2   Developer Pack, included in Visual Studio 2017   Runtime   Release Details
  4.6.1   Developer Pack, included in Visual Studio 2017   Runtime   Release Details
  4.6     Developer Pack, included in Visual Studio 2017   Runtime   Release Details
  4.5.2   Developer Pack, included in Visual Studio 2017   Runtime   Release Details
  3.5 SP1 Developer Pack, included in Visual Studio 2017   Runtime   Release Details
  </code></pre>
  
  <p>=> Where is 4.5? <br/>
  I have already different times downloaded 4.5.2 version, Developer Pack as well as Runtime, but nothing changes.</p>
  
  <p>So, after a while, I just close the dialog box about the missing target. I'm expecting to get a more readable error message, once I get to the compilation of the project.</p>
  
  <p>Next to that, I've also investigated the installation of my PC (PC settings, Add and Remove Programs), this gives following list:</p>
  
  <pre><code>Microsoft .NET Core SDK - 2.1.4 (x64)
  Microsoft .NET Framework 4.5 SDK
  Microsoft .NET Framework 4.5.1 Multi-Targeting Pack (ENU)
  Microsoft .NET Framework 4.5.1 SDK
  Microsoft .NET Framework 4.5.2 Multi-Targeting Pack (ENU)
  Microsoft .NET Framework 4.6 Targeting Pack
  Microsoft .NET Framework 4.6.2 SDK
  Microsoft .NET Framework 4.6.2 Targeting Pack
  Microsoft .NET Framework 4.7 SDK
  Microsoft .NET Framework 4.7 Targeting Pack
  </code></pre>
  
  <p>=> Ok, there seems not to be a targeting pack for 4.5 (only the SDK seems to be present), but what to do about it?</p>
  
  <p>The error message speaks about retargeting my application, but that's out of the question: I'm the only person, having this problem, and modifying the configuration of a central application is not a solution.</p>
  
  <p>The error message also speaks about the so-called "Global Assembly Cache" which will be used in place of reference assemblies. So, let's have a look at those things:</p>
  
  <p>I seem to have two reference assemblies on my PC:</p>
  
  <blockquote>
    <p>C:\Program Files\Reference Assemblies\Microsoft\Framework (seems only to contain "v3.0" and "v3.5" directories)<br/>
    C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.</p>
  </blockquote>
  
  <p>The latter seems to contain a ".NETFramework" directory, which, at his turn, contains a "v4.5" subdirectory, containing quite some XML files.</p>
  
  <p>The error message however states that those are not used, the "Global Assembly Cache (GAC)" is used instead. If I try finding this, I find references to <code>gacutil</code>, <code>sn -k ...</code> and other programs which are not found on my PC for the specied .Net framework.</p>
  
  <p>If I look, using Google, for "Microsoft .Net Framework 4.5 Targeting Pack" (exact phrase), I get zero results.</p>
  
  <p>So, in other words, I get a message about a missing piece of software on my PC. I get the opportunity to install it but the installation does nothing. Then I get a compilation error about this, which talks about a very general technology which seems not to exist following Google, the mostly used search engine on the internet. It mentions a technology (GAC) which might be used or not and who is found, either on <code>C:\Program Files</code> or <code>C:\Program Files (x86)</code>, and its corresponding tool (<code>gacutil</code>) seems only to exist on my PC for other versions.</p>
  
  <p>Can anybody give me a push in the right direction here?<br/>
  Thanks in advance</p>