Development Environment:
- Visual studio 2019 v16.6.2 is installed
- .Net5 preview 5 is installed
Microsoft.NETCore.App 5.0.0-preview.5.20278.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
- Enable the designer in Visual Studio
Tools > Options > Environment > Preview Features and select the Use the preview Windows Forms designer for .NET Core apps option. > re-start vs
I followed the instructions in this answer
I created a demo console project in .net5
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
</Project>
Then build and run using dotnet cli is ok
dotnet build #ok
dotnet run # ok
Trying to build the project in visual studio fail with errors
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 https://aka.ms/msbuild/developerpacks
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.
What I missed to build and run the project using vs 2019 v16.6.2 ?