Adding C++ projects to Visual Studio solution

Hello,

I just start using Unreal Engine and I can’t figure out something, I search on Google and here about this.
My question is if we can add another project in game solution, I want to create a C++ Console Application for a server test and a shared library between them. I know I can add them from right click menu but when I regenerate files from Editor it will be deleted.

You seem to know the answer yourself, UBT will regenerate solution according to unreal project files and overwrite everything you add. You will need to create separate solution(maybe copy solution) which will include game project files (you can find then in intermediate files) and your files, thats only work around that i can think of. You can always have separate solution for that test program, it does not sound like you be changing it a lot.

Hello,

Thank you for your answer. I had in mind to create a separate solution and see if I can link the .lib and headers files with current project from UE4. But I thought there is a easy way to do that like creating projects in current solution.

Thank you :slight_smile:

Open your unreal project’s solution .sln file in notepad.

It should show something like this near the top:

Microsoft Visual Studio Solution File, Format Version 12.00

Visual Studio Version 17

VisualStudioVersion = 17.0.31314.256
MinimumVisualStudioVersion = 10.0.40219.1
Project(“{2150E333-8FDC-42A3-9474-1A3956D46DE8}”) = “Engine”, “Engine”, “{233774A8-CC9D-3FA9-86D1-90573E92B704}”
EndProject
Project(“{2150E333-8FDC-42A3-9474-1A3956D46DE8}”) = “Games”, “Games”, “{DE1F8B53-6C02-3C13-9101-A7C8D96F3FF6}”
EndProject
Project(“{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}”) = “UE5”, “Intermediate\ProjectFiles\UE5.vcxproj”, “{45037D8E-756E-3A6A-AA4A-BEA53B65BC9F}”
EndProject

This is the list of vsprojects the solution references.
Open your external solution .sln file up in notepad, and copy the project id, name and location line and paste it as a new line in your unreal solution. You will probably need to change the directory to point to the new exact location if its not relative to your unreal project.
Save and reopen the solution in visual studio. Your external project should be in there now