Nothing happens when .exe is run outside of VS

I’ve been working on a monogame project in Visual Studio 2015 on windows 7 and it’s been running fine. When I try to run the release build outside of Visual Studio though, nothing happens. No window appears and I just get the waiting cursor forever. I checked my processes and I see my game’s .exe in the list, but can’t end it. Any ideas? The game works when I run it from the studio, but never from the .exe itself. All it is is a basic monogame project that references Farseer Physics, Lidgren, Json .Net, and my own Utility class library.

Edit: I’ve ported all the code to the OpenGL version of Monogame as well and it still hangs when I click on the .exe. I’ll wait awhile and see if it eventually loads something.

Conclusion: Well it turns out Avast Anti-virus was screwing it up. I cannot believe I didn’t try disabling it earlier. I’m still a little worried because I don’t know why the anti-virus stops it from loading and doesn’t give me any pop up or anything but at least I can develop in peace now.

This also happens running the release build in Visual Studio? Does a debug build do the same outside of Visual Studio? When it appears to be hung, switch to Visual Studio and select Debug -> Attach to Process, find the hung process and then select Debug -> Break to try to work out where it is stopped.

I just had that problem again today… With no way to stop the process, I had to reboot to regain access to “folders and files currently in use”…

I get that problem when I publish, and try to run the generated setup…

I have had these problems before, publishing/sharing is always such a chore that never makes sense to me…

Eventually, I just give up trying to create an installer, and just hand out my game in folders… A simple copy of my release folder…

I could really use a good step by step “how to create a simple one click installer”… Maybe it has something to do with EXPRESS ? I dont know…

No, it does not. When I run the release or debug builds inside of Visual Studio the game window pops up just fine and everything runs. But when I run directly from GameName.exe nothing happens. The weird thing is it doesn’t even freeze, it just seems to be perpetually loading.

It doesn’t matter which build I do, but when I try running the game from VS without the debugger it freezes as well. I also tried this on a completely empty monogame project: Created a brand new OpenGL project -> Debug - > Start Without Debugging, but it freezes right after building the project.

I tried attaching the debugger to the process and it instantly encounters a breakpoint and asks to break. When I choose to break it comes up saying that Source is unavailable.

Alright so here’s some progress. I created a published version of my monogame project and tried to run the setup.exe, it also froze just like the normal .exe files would, loading forever. However I then transferred the setup application over to another laptop and ran it and the program booted up just fine.

I’m going to try fully uninstalling and reinstalling Monogame and any other XNA related installations and see if that fixes anything. Besides that I’m not sure what could be the issue.

A note for others who may come across this.
I was having what seemed like the same issue. It turns out my game was running and then crashing immediately. This was due to the way I was loading files using relative paths. Double check how you are loading files and make sure that the file paths changing is not the issue.