"Generate Visual Studio project files" automatically closes output window after error

Using 4.16 installed via the Epic Launcher, I am updating a project from 4.15 to 4.16.

Generating project files fails because of an error, and then the output window is immediately auto-closed leaving about 1 frame to try and read the error message.

Probably the most frustrating thing I’ve ever experienced on a computer.

I’m poking around to see if the output is written to a file somewhere, but seriously… if a warning or error occurs generating project files please don’t close the output window. It would be really useful to be able to see what the error message was, plus it’d be nice if there was some difference in output between success and failure.

As it stands, in both cases the progress bar goes to 100% and then the window closes, if I didn’t compulsively click “Show Log” and delete the old project.sln I wouldn’t even know there was anything wrong (until I opened Visual Studio and it gave me an error out of the Dead Sea Scrolls).

EDIT: Disregard - better solution below that I can’t vote on :X

Crappy solution but it does work…

cmd/> {UE4InstallRoot}\Engine\Build\BatchFiles\Build.bat {ProjectName}Editor Win64 Development “{ProjectFolderRoot}/{ProjectName}.uproject” PAUSE

1 Like

Bump. This issue drives me around the frigging twist.

PAUSE doesn’t work for me either

Found a very cheeky workaround. When you generate vs files, show the log, then when you see the scroll bar, click and hold it and it will remain open. The only problem is that you have to catch it when the error message displays since it will not update the message when the scroll bar is held. Good luck! :smiley:

From - Generate project solution without Engine project - C++ Programming - Unreal Engine Forums

To save a click here’s a batch file I’ve been using (substitute your paths for anything in {})

"{EPIC_GAMES_PATH}\{UE_VERSION}\Engine\Binaries\DotNET\UnrealBuildTool.exe" -projectfiles -project="%~dp0{PROJECT_FILE_NAME}.uproject" -game
PAUSE

Unfortunately the engine source seems to always be included now, so while this didn’t solve the question I linked (and found it from) it does nicely solve this problem… except now I’d really love to have a .sln without the UE4 source as it does slow down intellisense and VAX quite a bit :confused:

Also psssst, Epic… document your cmd line APIs kthx :stuck_out_tongue:

Found a more workable solution…

In a batch file -

"{EPIC_GAMES_PATH}\{UE_VERSION}\Engine\Binaries\DotNET\UnrealBuildTool.exe" -projectfiles -project="%~dp0{PROJECT_FILE_NAME}.uproject" -game
 PAUSE

Check if you have more than one version of VS installed. I took the error in a slow motion video and found it mention an error with the VS 2015. I had both 2015 and 2017 installed. After uninstalling 2015 it compiled normally. Also make sure you have installed the NuGet package manager in 2017 or it will throw another error.

Edit: you can take slow motion video with many phones. there are apps for that too if it doesn’t come with your phone.

It’s an old question but if someone stumbles on it.
To find the logs from generator go into:
YourProject/Saved/Logs/UnrealVersionSelector-[YourDate]
Sorting files by Date modified should show you newest file.