MonoGame 3.8 publish issue when using trimmed flag

I’m trying to publish a MonoGame 3.8 dotnet core project using the /p:PublishTrimmed=true flag, but I’m met with an error when publishing (see pic below). The project has a DirectX project that calls the main game code in a MonoGame .net standard shared project. It also has a utility project that is a .net standard class library

When I publish a 3.8 project there are alot of System dll’s which push the publish folder well over 100MB for a game that is only a couple MB in size.

Anyone had errors like this before?

Edit: I tested publishing using the trimmed flag on a new project DirectX project that has no references to other project and the error still occurs.

Hey @Emmsii, Welcome Back.

I think that is the dependencies being included?

Maybe if you outline your entire export process or include links, someone may be able to help more.

Keep in mind the .NET Core trimming stuff is in preview and is experimental, so it may unfortunately be hit and miss:

If you are publishing, you have options to deploy as Framework-dependent (expects you’ll already have .NET Core installed, and your program will be small) or Self-contained (you pack in all the Framework stuff yourself, and the program will be really large).

You may want to try Framework-dependent, and then let people know where to download .NET Core. In fact, if you try to open a .NET Core exe and don’t have it installed, I believe the user is prompted to download it.