Which Monogame File do you use to Distribute?

I’ve finished creating a project in Monogame and I know that the user needs to install .NET and Monogame to run the game (unless the XNA redistributable will work). I developed my game in Visual Studio 2015 and used Monogame 3.5. Which files do I need to distribute? Will XNA work (even if it’s still not the exact thing as Monogame)? Do you need any files other than the project files and .NET at all? If you need any more info, just ask. Thank you in advance.

Whatever is in your bin folder will do. You might even be able to remove some of the dependencies, e.g. the SharpDX.MediaFoundation dll if you don’t use video.

When I attempted to run the game after installing it on a virtual computer, the game didn’t start. It said that Windows ran into some sort of problem. The windows opens but nothing is drawn. However, I have a method for error handling that will catch errors from almost anywhere in the program as long as it is able to start. There are some places where it could run into errors but why would it consistently run into errors in a place where it didn’t run into any during testing? Especially since I can’t find a way that an error could be occurring in these places. Thus, I think the error happens which the Run method is called. Any ideas?

What was the error? Make sure you have all the dependencies in the same folder as your executable.

I get a popup that says “[Game] has stopped working.” It doesn’t give any additional information. I also checked and all dll’s are in the file with the executable.
I’m using Inno Setup to publish. I’m not sure what difference this makes but it might help narrow down the issue a little more.

You need to make sure DirectX redistribuable is on the machine.
You may need to include FreeImage.dll too

What does that produce? Can you try running your game on the other computer without using InnoSetup?

I don’t have the FreeImage.dll file in my installation executable right now. Where would I find that file?

I think freeimage is only needed for the content pipeline, not for the game itself.

So I don’t need to distribute freeimage.dll once I’ve finished my game?

Windows crash dialog doesn’t give you any info? can you paste a screenshot with the “details” tab expanded?

There was no “Details” tab…

I believe you are correct and DirectX may be the issue. I’ll try to add the distributable for it and get back to you guys when I’ve finished.

You need to log the exception yourself then.
Add a try/catch in your Main() function, and write the exception to a file.

I installed DirectX on the virtual machine and made the program show a textbox if it catches an error. Here’s the error:

“imgnotfound” is the name of one of the image assets in my game. It is the first to be loaded and is used to replace any image files that failed to load correctly. Does anyone know how to fix this? I looked online and had trouble finding anything that seemed to work for my situation.

The .xnb files are missing in the Content folder

1 Like

I found them all right here? I found somewhere that you need to add all the xnb files to the solution in Visual Studio. Is this what you mean?

I couldn’t find in Monogame sources where an exception with this message is thrown,
can you use exception.ToString(), save the string a file, and post here?

have a look at this stackoverflow answer: https://stackoverflow.com/a/25495104

@DanielG Make sure the location of your content relative to your game executable is correct (i.e. the same as in your bin folder). The publishing tool you’re using might mess that up.

Here’s the file with the error message, the exception.ToString(), and I also added the Stack trace and the target