Example Project Doesn't Have Visual Studio Solution

Hello all,

So I downloaded the Strategy Game example project off of the marketplace but it did not create a Visual Studio Solution for the code.
Is there a way to generate the .sln file for Visual Studio from the Editor without having to add a new source file that will just get deleted later?

Thanks.

Just add a code file to the project and say yes when it ask to edit it, it’s will open the whole solution

Thanks for the quick reply.

I did this and it does work. However, is there a way to generate the solution without having to add a code file?
It’s really not that big of a deal but it does work.

Thanks.

Once you did that a solution file will be in your folder Unreal Projects\StrategyGame\Source

I am pretty sure the solution file should be generate in the root directory of the project.

Just discovered something with what you said, right-click on .uproject file and select ā€œGenerate Visual Studio Filesā€

3 Likes

Adding a code file to the project generates the solution, but ā€œGenerate Visual Studio Filesā€ doesn’t seem to do anything for me. Strange.

It seems if a ā€œSourceā€ directory exists with code files (in the case of the example projects off the marketplace), then ā€œGenerate Visual Studio Filesā€ works for exactly what I need.
However, if no source files exists, you have to add a new source file (which makes sense anyway).

Thanks for the help everyone.

That’s not the case, for me; I’m trying it with the Strategy Game demo but no dice.

everyone and thank you for this awesome Engine. My friend got UE4 and we are both discovering it. His english is not good enough, that is why I am speaking of his behalf. Well, it seems we are encountering the same problem as here: ShooterGame / StrategyGame won't open in an editor built from source - Community & Industry Discussion - Epic Developer Community Forums we can not open ShooterGame and StrategyGame and we got the same message: ā€˜ShooterGameLoadingScreen’ could not be found. Please ensure that this module exists and that it is compiled." After running the RegisterShellCommands.bat as an admin, we got the ā€œGenerate Visual Studio Files.ā€ by right clicking on ShooterGame.uproject and StrategyGame.uproject and according to this: A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums , we should get the sln file of the game and then start the steps that you mentionned. Unfortunately, the VS project wasn’t created "Just above your Strategy Game project, you should see a new file for Visual Studio. Open it up to take a peek at all of the C++ code behind your game! " like how the tutorial indicates. So If we didn’t get the sln file, then we can not continue the following steps to make the project run. Can you please help us? Thanks.

We have the source directory, but when clicking ā€œGenerate Visual Studio Filesā€ , nothing happens and the sln file will not be created.

I’m still having problems with this; installing the latest version now, though.

Not a big deal, just inconvenient.

Here’s a very straightforward way to generate your project files. In the folder with your .uproject file, create a .bat file, and make it something like this



call "%~dp0..\..\UnrealEngine\GenerateProjectFiles.bat" "%~dp0StrategyGame.uproject" -Game -Engine
PAUSE


Personally I’m using a relative path for the the .bat file, you’ll probably want to use an absolute path. Also, If you’re just compiling the game code and aren’t modifying the engine code, you can skip adding the ā€œ-Engineā€ parameter.

1 Like

Good tip, thank you

Note that not all marketplace projects have code - Swing Ninja for example. When you try and generate the code files for these it will complain and fail as these are done in Blueprints not C++. You can however add code to the project by the methods suggested above.

Doing it that way works, for me.

Thanks a lot, bro.

Right-click on the .uproject file, select ā€œGenerate Visual Studio Project Filesā€ from the context menu