Unreal opening new instance of Visual Studio every time a class is added

I already have my project open in Visual Studio, but Unreal still opens up a new instance each time I add a new class. This did not happen before 4.18.2. Is there a way to prevent this?

I see that this is actually a known issue and that a fix is upcoming. Would like to expand a little on my issue in case others have experienced the same but will wait for the update. In addition to opening extra instances of Visual Studio, this bug also loads the new c++ file in QT Creator.

Others have mentioned that, after opening a new VS window, the "Loading Visual Studio…"message in the UE IDE remains. After a few minutes - this opens yet another instance of VS for me as well as an instance of QT. Very strange bug and hoping the fix solves it.

I am expiriance the same issue. If I create new class or even try to edit existing, UE opens new instance of visual studio.

I am expiriance the same issue. If I create new class or even try to edit existing, UE opens new instance of visual studio.Some times it opens two of them.

This is a known issue with UE and a fix has been made. I believe it is supposed to be included in the next big release.

I’ve had this and what worked for me is to make a slight engine modification if you are running from source.

It seems to only be a problem if your projects are not in the same directory as your engine, as it’s only checking the relative path of the project or something. In VisualStudioSourceCodeAccessor.cpp, line 223 change it from:

if (Filename == InSolutionPath)

to

FString AbsoluteSolutionPath = FPaths::ConvertRelativePathToFull(InSolutionPath);
if (Filename == InSolutionPath || Filename == AbsoluteSolutionPath)

That seemed to do the trick for us.

I tried this in 4.19 preview where the issue is supposed to be already fixed but its not. Now it doesn’t spawn a new instance of VS2017 but it doesn’t actually do anything at all, I can’t open a class from the editor with this ‘fix’.

I had tried this in 4.18.2 as well with the same result. I get an error along the lines that UE cannot open Visual Studio. This may be due to the fact that I am not practiced at using my own custom builds. It is disappointing that 4.19 has not fixed this yet.

I resolved this by simply creating the project in the same directory as the engine source
V4.20

That doesn’t solve my issue as my engine builds and projects are kept on different disks due to work policy.