Merge/Embed multiple assemblies with/into a monogame app

I have made an app in monogame. When I build it, I get something that looks like this:
enter image description here
and my app structure looks like this:
enter image description here
The highlighted “Program.cs” file is the one that contains the main entry point for the application, it look like this:

using System;

namespace MapEditor
{
#if WINDOWS || LINUX
    /// <summary>
    /// The main class.
    /// </summary>
    public class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>

        [STAThread]
        static void Main()
        {
            using (var game = new MapEdit())
                game.Run();
        }
    }
 #endif
}

I would like to merge/embed these within MapEditor.exe.
Here are the things I have tried:

  • Using jeffrey richter’s method.
    • The error I get is that the app still can’t find the file.
    • I have also tried the CodeProject version of this
  • Using ILMerge through the command line
  • Using the GUI version of ILMerge doesn’t work
    • It throws an error about it not being compatible with .Net 4.7
  • Using the batch script for ILMerge
    • It just puts the arguments for ILMerge onto the command line

Very many thanks to any help received, I am new to monogame and really like it!

Tried using Fody / Costura? It mostly just works.

Alternative, you can put them into a sub-folder and set it up in your app.config via probing.

Many apps do not embed dlls. Even Microsoft ones and many games engines.
And it may create other issues not foreseeable for instance

Thanks! I used this method after all and it worked!
From now on I will use community.monogame.net for any questions related to a monogame project. Thanks a ton!!!

I have already finished developing this app, and also, it is more of like a side tool that shouldn’t be too large.