dmr
dmr
CC#
Created by dmr on 9/16/2024 in #help
MSB4019 error when building Windows game binary on Linux
I'm learning C# and MonoGame, and I wanted to verify that I could successfully build a redistributable windows binary of my WIP game, so I decided to first confirm I could do it with one of the MonoGame sample projects, in this case AutoPong (see https://github.com/MonoGame/MonoGame.Samples). Attempting to build, I get the following
/usr/share/dotnet/sdk/8.0.108/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(1355,3): error MSB4019: The imported project "/usr/share/dotnet/sdk/8.0.108/Sdks/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.NET.Sdk.WindowsDesktop.targets" was not found. Confirm that the expression in the Import declaration ";/usr/share/dotnet/sdk/8.0.108/Sdks/Microsoft.NET.Sdk/targets/../../Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.NET.Sdk.WindowsDesktop.targets" is correct, and that the file exists on disk
/usr/share/dotnet/sdk/8.0.108/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(1355,3): error MSB4019: The imported project "/usr/share/dotnet/sdk/8.0.108/Sdks/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.NET.Sdk.WindowsDesktop.targets" was not found. Confirm that the expression in the Import declaration ";/usr/share/dotnet/sdk/8.0.108/Sdks/Microsoft.NET.Sdk/targets/../../Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.NET.Sdk.WindowsDesktop.targets" is correct, and that the file exists on disk
I have no idea whether the import declaration is correct, although it seems reasonable, but the file definitely does not exist on disk. This makes me think there's something I'm supposed to have installed in order to be able to build a Windows desktop binary. Maybe a nuget package that enables the target? Unfortunatly I'm not very familiar with the dotnet build system, and it's really hard to search for info on this (I keep getting "how to build for linux on windows"). So I hope somebody can help me, because I bet this is really easy if you're less ignorant of dotnet than I am.
8 replies