MSBuild Error when I create a UWP solution in rider

My environment:

VS not installed. Only Rider.

Lasted .net Core 3.1 installed

Lasted Windows 10 SDK installed 

-----------------

When I new a UWP solution in the Rider and use the default template. Rider can not find the MSBuild

In the `File | Settings | Build, Execution, Deployment | Toolset and Build' Setting.

The Path of the MSBuild is point to the Jetbrain's MSBuild in the Rider folder.

The log is.

```

15:36 Project 'UwpDemo' load finished with warnings: [MSB4019] 找不到导入的项目“C:\Program Files\dotnet\sdk\3.1.301\Microsoft\WindowsXaml\v16.0\Microsoft.Windows.UI.Xaml.CSharp.targets”。请确认 Import 声明“C:\Program Files\dotnet\sdk\3.1.301\Microsoft\WindowsXaml\v16.0\Microsoft.Windows.UI.Xaml.CSharp.targets”中的表达式正确,且文件位于磁盘上。 C:\Users\tiger\RiderProjects\UwpDemo\UwpDemo\UwpDemo.csproj at (137:5)

15:41 Project 'UwpDemo' load finished with warnings: [MSB4226] 找不到导入的项目“C:\Users\tiger\scoop\apps\jetbrains-toolbox\current\apps\Rider\ch-0\201.8538.1\tools\MSBuild\Microsoft\WindowsXaml\v16.0\Microsoft.Windows.UI.Xaml.CSharp.targets”。此外,已尝试在 $(MSBuildExtensionsPath) - "C:\Program Files (x86)\MSBuild" 的回退搜索路径中找到“Microsoft\WindowsXaml\v16.0\Microsoft.Windows.UI.Xaml.CSharp.targets”。这些搜索路径在“C:\Users\tiger\scoop\apps\jetbrains-toolbox\current\apps\Rider\ch-0\201.8538.1\tools\MSBuild\Current\Bin\MSBuild.exe.Config”中定义。确认 <Import> 声明中的路径正确,并且该文件位于某个搜索路径中的磁盘上。 C:\Users\tiger\RiderProjects\UwpDemo\UwpDemo\UwpDemo.csproj at (137:13)

15:41 MSBuild targets were not found: Make sure that all SDKs required for projects in this solution are installed, or specify a different MSBuild version in settings.

```

I am sorry I can not change the language of the log to the English.

 

0
2 comments

Hello, Yuehao Sui!

To work with UWP without installing Visual Studio, one needs to download "Microsoft Build Tools for Visual Studio 2019" from https://visualstudio.microsoft.com/downloads/.

Run the installation package. In the "Workloads" tab choose “Universal Windows Platform build tools”.

After installation finished, restart Rider, then open Rider’s settings page "File | Settings | Build, Execution, Deployment | Toolset and Build"  and set MSBuild installed on the previous step there...

Your project should run without issues.

 

Best regards,

Maxim Isaev.

 

1
Avatar
Permanently deleted user

@Maxim Isaev, Thanks a lot.

0

Please sign in to leave a comment.