title: .NET 5 cant be selected as Target Framework in VS2019, reference assemblies not found
body: <p>I cant get Visual studio to use <strong>.NET 5</strong>.</p>
  <p>The following are my current configuration:
  Visual Studio Professional 2019 version: 16.7.6</p>
  <p>.NET sdk: dotnet-sdk-5.0.100-preview.7.20366.6-win-x64 <em>(see image for more info)</em></p>
  <p><a href="https://i.stack.imgur.com/WUm6E.png" rel="noreferrer"><img src="https://i.stack.imgur.com/WUm6E.png" alt="enter image description here" /></a></p>
  <p><strong>Visual Studio settings:</strong>
  I have selected &quot;Use previews of the .NET Core SDK&quot; in VS <em>(See image)</em>
  <a href="https://i.stack.imgur.com/eJCG8.png" rel="noreferrer"><img src="https://i.stack.imgur.com/eJCG8.png" alt="enter image description here" /></a></p>
  <p><strong>Possible source of my problem:</strong>
  I accidentally installed preview 8 of .NET 5, this version don't support my version of Visual Studio. I removed this version and installed the correct one <em>(preview 7 should have support for VS 16.7, see: <a href="https://dotnet.microsoft.com/download/dotnet/5.0" rel="noreferrer">https://dotnet.microsoft.com/download/dotnet/5.0</a>)</em></p>
  <p><strong>These are the steps I take to reproduce my problem:</strong></p>
  <p>in visual studio I do the following to create a .net 5 project (blazor project):</p>
  <ol>
  <li>start vs 2019</li>
  <li>select &quot;Create a new project&quot;</li>
  <li>select &quot;Blazor App&quot;</li>
  <li>give the project a name/Location/solution name and click &quot;Create&quot;</li>
  <li>select <strong>.Net 5.0</strong> (.net core 3.1 is also available) and Blazor Server App and click &quot;Create&quot; (see image)
  <a href="https://i.stack.imgur.com/vjxzG.png" rel="noreferrer"><img src="https://i.stack.imgur.com/vjxzG.png" alt="enter image description here" /></a></li>
  </ol>
  <p>6.the project is now created but a error message is instantly displayed <em>&quot;the reference assemblies for .NETFramework, Version=v5.0 were not found. ...&quot;</em> (see image)
  <a href="https://i.stack.imgur.com/L8xzS.png" rel="noreferrer"><img src="https://i.stack.imgur.com/L8xzS.png" alt="enter image description here" /></a></p>
  <p>7.right click on the project -&gt; Properties
  8. &quot;Target framework&quot; are now blank, If i open the dropdown only .Net framework versions are available (see image)
  <a href="https://i.stack.imgur.com/wle6c.png" rel="noreferrer"><img src="https://i.stack.imgur.com/wle6c.png" alt="enter image description here" /></a></p>
  <p><strong>Other information that might have value:</strong>
  If i creat a new project and select .Net core 3.1 instead of .net 5 everything is working fine.
  Doing this alows me to see items other than .Net framework in the &quot;Target frameworks&quot; dropdown, .NET 5 are however still missing. (see image)</p>
  <p><a href="https://i.stack.imgur.com/2nxKZ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/2nxKZ.png" alt="enter image description here" /></a></p>
  <p>If i go to &quot;Add or remove programs&quot; .Net 5 of the correct version are listed. <em>(it is also the only listed version of .NET 5)</em></p>
  <p>If i look at the <em>system path</em> it is correctly set to: <em>&quot;C:\Program Files\dotnet&quot;</em></p>
  <p>Why is this happening? how can i get .net 5 to correctly show in this list?</p>
  <p><strong>#Update 1:</strong>
  After installing Visual studio <em>16.8.0 Preview 5.0</em> the problem still persists .NET 5 can't be used. If i look at Dependencies it is clear that something is wrong, non of the entries under Dependencies -&gt; Assemblies are found/has a value (see image)</p>
  <p><a href="https://i.stack.imgur.com/Kt6rD.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Kt6rD.png" alt="enter image description here" /></a></p>
  <p><strong>#Update 2:</strong>
  finally found a solution 4 this problem using global.json, see my own answer for more details</p>