Is it possible to build a .NET 5 project with the Visual Studio Build Tools? Or is my installation not working?
Note: I can't use the dotnet.exe, since i have to build with the WiX-Toolset.
Installed:
msbuild.exe used from C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin
Error:
C:\Program Files\dotnet\sdk\3.1.403\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(93,5): error NETSDK1013: Der TargetFramework-Wert "net5.0-windows" wurde nicht erkann
t. Unter Umständen ist die Schreibweise nicht korrekt. Andernfalls müssen die Eigenschaften TargetFrameworkIdentifier und/oder TargetFrameworkVersion explizit angegeben werden. [C:\GitLab-Runner\builds
\mq82bps2\0\capps\developer\mfinder\MFinder\MFinder.csproj]
Also the msbuild.exe searches in the path C:\Program Files\dotnet\sdk\3.1.403\
and not C:\Program Files\dotnet\sdk\5.0.100\
. Any hints on that?
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net5.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
If you want to use Build Tool, you should note that .NET 5.0
is released since 16.8
. So you should update your build tool to 16.8.x
and then you can build .NET 5.0
projects.
Also, if you just use command line, you can directly download .NET 5.0 Sdk and then use dotnet build
.
And if you installed .NET 5.0
and want to use VS IDE, you should also update VS to 16.8.x
.
Updated, thank you! But i have to relay on msbuild.exe to make use of the WiX Toolset