How can I resolve the error "Game module could not be found" when switching to Debug Editor?

hi All

I’ve followed these steps to start an instance of my game in debug mode:

In Visual Studio, in the project I want to debug, I’ve switched to debug editor, set some break points, and hit F5.

Once it finishes building, a version of the project browser opens that’s different from the normal one- it has diagonal stripes around the edges. I click on the project that I’m debugging, and get a message saying ‘The game module ‘ledgegrab’ could not be found. Please ensure that this module exists and that its compiled.’ I compiled the project in development mode immediately before switching to debug. Not sure why the game module wouldn’t have compiled, at that point, since the build was successful. Certainly it opens and runs in the editor, before the switch to debug mode.

Have I done something wrong or is my project directory the problem? I haven’t moved anything around, only compiled new builds of the engine…? I’ve searched the project files but not sure of the precise filename I’m looking for, there’s a ton of files with the word module in them…

This seems like it holds some clues;

And this;

Not sure why projects were running in most other respects, but the second link in the comment above fixed it, from Shadowriver;

One last thing. You’ll want to setup
your Windows shell so that you can
interact with .uproject files. Find
the file named
UnrealVersionSelector-Win64-Shippping.exe
in the
UnrealEngine/Engine/Binaries/Win64/
folder and run it. Now, you’ll be able
to double-click .uproject files to
load the project, or right click them
to quickly update Visual Studio files.

Hi ,

I did some testing and I believe I have an idea of what is causing the error message you received. I am guessing that you had previously built your project and engine in the Development Editor Solution Configuration and this is the first time you were using the Debug Editor Solution Configuration? If the only thing that you did was to change the Solution Configuration to Debug Editor, then press F5, it is perfectly normal for that error message to appear. The reason for this is because VS builds and launches the Editor in the Debug Editor configuration, but it does not build the project in Debug Editor configuration. So when you select your project in the Project Browser, the project is still using the Development Editor Solution Configuration while the Editor is using Debug Editor, and that conflict appears to be what prompts the message to appear.

Instead of changing the Solution Configuration and immediately pressing F5, try building the solution in the new Solution Configuration first, then press F5. Following those steps allowed me to successfully open the same project using various Solution Configurations.

One other thing that I noticed is that when you press F5 to run the solution in debugging mode in VS, the debugging mode only lasts through the selection of the project in the Project Browser. Once the actual Editor starts to load, VS exits debugging mode. Another option if you want to keep VS in debugging mode while you have the Editor open would be to right-click on your project in the Solution Explorer window in VS, then select Debug → Start new instance. This will put VS into debugging mode and load you straight into your project in the Editor (this will also avoid the error message that you were seeing if you change the Solution Configuration).

Ok. That’s a strangely subtle point. I had assumed that when I run debug, in debug editor mode, it is building the solution in debug mode. However, look at this; Possible bug/conflict between project browser and engine versions - C++ - Unreal Engine Forums

If I successfully debug the solution, then switch to development editor and build the project, I get that error message when opening it in the project browser.

Ok, I’m being thick. I get what you’re saying…

Hey . I tried to build the project in debug editor mode and got the message “The debugger’s worker process (msvsmon.exe) unexpectedly exited. Debugging will be aborted.”. Then “Unable to start the program…” and the path to my github project. Right clicking on my .uproject file, my currently selected version is 4.1. I have the option of that, or the github “version”. Except there’s only one version on my machine, and it’s 4.1, and in the github folder…

I suspect that the success or failure depends on which version I have selected on the .uproject, one does debug, the other development editor. I’ve opened the launcher, it is whited out, saying uproject files are not associated with this launcher, would you like to associate them now. I’ve clicked “fix now” before, but it doesnt unite the two branches. The launcher says “launch”.

Hey by the way, thanks for this…

Hey , if I could see my github version on the drop down menu on the launcher, I’d select it. I’m hoping you mean something more obscure than that… :slight_smile:

Hi ,

That is an error message I have not come across before in VS. I will have to do some digging to figure that one out. Do you get any errors if you try to build in Development Editor?

Regarding your question about the Editor Version Selection options, whenever you see the Launcher up, on the top left under your name there should be a big yellow button. Does that button say “Launch” or “Install”?

If the button on your Launcher shows “Launch” that means you have a version of the Editor installed from binaries as well as your version built from source. So when you are looking at the Editor Version Selection options, “4.1” refers to the binary version, and the address pointing to your GitHub folder is referring to your source version. I did a quick check to see how that tool changed when I uninstalled one of my binary versions, and the option for that Editor disappeared from the tool, then reappeared when I re-installed that binary version.

One thing I have noticed when comparing projects I have created using the binary Editor is that they lack the Debug Editor option in VS. All they show are the Development and DebugGame options, as well as Shipping. The projects I create in Source have many more Solution Configuration options available. I would recommend using the Editor Version Selection tool to associate your project with your GitHub installation, then try rebuilding the project in Development Editor configuration.

When the Launcher asks you to associate project files with it, it is (generally) fine to say no.

I still need to do some investigation into the VS error message you received. Unfortunately most of our staff has already left for the day, so I may need to get back to you tomorrow on that one.

Sorry, I was not very clear. Right-click on your .uproject file and select “Switch Unreal Engine Version…” That is where I was saying you should find your GitHub Editor version.

Right, thats what I’ve been saying I’ve been doing. If I switch to that version, it works in development but not debug. I can build the project in development, works fine. If I then rebuild in debug, when I run debug it says “this project is out of date”, rebuilds it, and then I get the error messages that I told you about… Lets knock off, see you tomorrow…

I hope you had a good evening! Is there any way to completely delete all traces of the editor, launcher etc in order to get a clean re-install? Without losing the project files. I can’t recreate what I did to get the debugger working, and the install seems to be corrupt in some way. Ideally I’d just like to use the github version, with no conflicting references on the install or on my machine…

I’m looking at the windows uninstall program helper. Unreal Engine is 112 MB. If I uninstall that, remove all the github files and completely re-install from github, would that solve this problem? restarting the software/machine makes no difference…

I’ve got the debugger working again on the gihub version, but even if I redo the vs project files from the .uproject, building the development editor doesnt work. I get a message saying "The game module ‘ledgegrab’ does not appear to be up to date. This may happen after updating the engine. Please recompile this module and try again.’

One more thing, I definitely don’t have a binary version on my machine. However, one time when the launcher started up, it began installing 4.1. At that point I had deleted 4.02 and had installed 4.1 github version. I cancelled the install as fast as I could. Maybe it has installed enough of it to cause this problem? The product version of the 112 Mb I can see on the windows uninstall helper is 1.0.3.0, so I’m guessing that must be the launcher…

The solution is simple.

Right click on the .uproject to see if you have a choice between different engine versions. I had 4.1 and github. Select github. Use the launcher to uninstall 4.1 (I never allowed it to fully install anyway, far as I’m aware). Right click on the .uproject and update the vs files.

Here’s the bit that had me stumped- don’t build the project in vs, in development editor using “build”, use “rebuild”. For me, “build” made no difference. Maybe that’s an obvious point if you’ve been using vs for a while, but I’m an XCode refugee. From this point on, build the solution in debug editor to debug, build in development editor to run normally, works fine.

Beware- as soon as you run the project again, the launcher tries to reinstall 4.1, automatically, which must be what caused the problem in the first place. To use it in off line mode, log out of it and there’s a button to set it to offline…