Cannot run release exe file on another computer

Hi all, I have recently been working on a monogame project and have it
working correctly on my own PC that I am developing it on (in both Debug
and Release mode). It will even work correctly when I move the release folder to a different drive and run from there. but when i try to run it on another computer by
copying all the files in the release folder the exe does not run. It
looks like it loads something then does nothing. On windows event viewer
I get an error of System.IO.FileNotFound exception at XNA Framework and
I think the Main game Method. I have installed .NET 4.5 and XNA 4.0 on
the target PC also.

Here is what is shown in Event Viewer:

Framework Version: v4.0.30319

Description: The process was terminated due to an unhandled exception.

Exception Info: System.IO.FileNotFoundException

at Microsoft.Xna.Framework.FrameworkDispatcher.Initialize()

at Microsoft.Xna.Framework.FrameworkDispatcher.Update()

at Microsoft.Xna.Framework.Game…ctor()

at GameName.Game1…ctor()

at GameName.Program.Main()

I resolved this issue on one pc by installing Visual Studio on it
with Monogame for VS, then the game can run, but if it doesn’t have
visual studio + monogame for vs on the computer it won’t run.

I’ve also tried publishing within the Visual Studio option but I get “the application is improperly formatted”

If anyone knows how to resolve, I’d greatly appreciate it.

Have you tried installing the visual studio redistributables? (2012 and./or above)
They should be found along with your visual studio IDE somewhere in the folders.

Are VC++ redistribuables a requirement for Monogame? I can’t see what would require it

Isn’t DirectX that got installed with Visual Studio?

I tried installing Visual Studio Redist on the target PC. It didn’t fix. I’ve been trying to get more detail in process monitor but not sure exactly what I’m looking for, and one difference is I get a path not found for SharpDX.dll and SharpDX.exe. Those files don’t exist in the project (where it is looking for them) even for the PC that has the project working. Was there any other dependencies that are needed with monogame that I might have forgotten? I’ve tried OpenAL, .NET 4.5 (was already installed), XNA 4.0, VC++ 2012.

You don’t need OpenAL, XNA or the VC++ 2012 Redist installed to run a MonoGame game.

If it’s a DX project you do need to include the SharpDX assemblies. Maybe they are in the GAC on your other computer so they’re not required to be in the same folder as the executable.

Thank you, I have added SharpDX.dll and SharpDX.DXGI.dll to the project folder and it now works correctly on another PC.

1 Like