title: Visual studio 2019 v16.6 can't build .net5 console application and raise errors: .NETFramework,Version=v5.0 were not found
body: <p>Development Environment:</p>
  <ul>
  <li>Visual studio 2019 v16.6.2 is installed</li>
  <li>.Net5 preview 5 is installed</li>
  </ul>
  <blockquote>
  <p>Microsoft.NETCore.App 5.0.0-preview.5.20278.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]</p>
  </blockquote>
  <ul>
  <li>Enable the designer in Visual Studio</li>
  </ul>
  <pre><code>Tools &gt; Options &gt; Environment &gt; Preview Features and select the Use the preview Windows Forms designer for .NET Core apps option. &gt; re-start vs
  </code></pre>
  <p>I followed the instructions in this <a href="https://stackoverflow.com/questions/60843091/net-5-is-not-available-in-visual-studio-2019">answer</a></p>
  <p>I created a demo console project in .net5</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;Project Sdk=&quot;Microsoft.NET.Sdk&quot;&gt;
  
    &lt;PropertyGroup&gt;
      &lt;OutputType&gt;Exe&lt;/OutputType&gt;
      &lt;TargetFramework&gt;net5.0&lt;/TargetFramework&gt;
    &lt;/PropertyGroup&gt;  
  &lt;/Project&gt;
  </code></pre>
  <p>Then build and run using dotnet cli is ok</p>
  <pre><code>dotnet build  #ok
  dotnet run # ok
  </code></pre>
  <p>Trying to build the project in visual studio fail with errors</p>
  <blockquote>
  <p>Error  MSB3644 The reference assemblies for .NETFramework,Version=v5.0 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at <a href="https://aka.ms/msbuild/developerpacks" rel="noreferrer">https://aka.ms/msbuild/developerpacks</a></p>
  </blockquote>
  <blockquote>
  <p>Error  NETSDK1005  Assets file 'F:\projects\Net5Demo\obj\project.assets.json' doesn't have a target for '.NETFramework,Version=v5.0'. Ensure that restore has run and that you have included 'net50' in the TargetFrameworks for your project.</p>
  </blockquote>
  <p>What I missed to build and run the project using vs 2019 v16.6.2 ?</p>