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
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.
4 Replies
are you trying to build the WindowsDX solution? that won't work
I am
why not?
the WindowsDX project is targeting
net8.0-windows
. it means that the project pulls in Windows-specific APIs and libraries and build logic (in this case, it looks like WindowsDX uses Windows Forms). these Windows-specific libraries cannot all be built from public source (there are some proprietary libraries among them), and it is generally a hard rule for maintainers of distro packages that there can't be proprietary blobs inside of packages, so the WindowsDesktop assets needed to support net8.0-windows
are generally excluded when distro maintainers build their .NET packages
if you install the Microsoft-built version of .NET then these assets are available and the build would succeed
generally you can distribute the DesktopGL version on Windows just fine. i don't know if there is a substantial performance difference between them^ this is correct & worked