UE4 failing to detect visual studio Community 2015

Ever since upgrading to 4.12 I have not be able to package my project due to UE4 not able to detect VS community 2015.

I have reinstalled both UE4 and VS2015 multiple times to no avail. I have tried with VS2015 update 1, 2 and 3.

I have confirmed environment variable paths are correct, registry is correct, and that VS2015 is configured appropriately.

This has been a source of much pain and considerable time sink, I would appreciate any help even if it is a second set of eyes to make sure I didn’t overlook any of the basic steps.

Please see the following mega image:

Hello treemakesagame,

You seem to of covered all of the things I would have suggested to check. The only other thing I can think of is to ask if your installation of the engine is on an external hard drive as that has been known to cause problems. I’ll try looking into what else could be the problem.

This may sound silly and might be wrong, but can you check to ensure that the path set in the registry and the environment variable actually match up with your Visual Studio installation? It’s possible that it was installed elsewhere such as Program Files instead of Program Files (x86) or on another drive.

Also, please open up the installer (You can do this without uninstalling by going to Programs & Features, selecting VS2015 and hitting “Change”), hit “Modify” and ensure that you have “Common Tools for Visual C++ 2015” checked under “Visual C++”. This should normally just give an error saying that it isn’t installed if this is the case, but sometimes it can show other symptoms such as this.

Hello Matthew,
Installation is not on external media, I have tried installing on both standard hard drive and and SSD both connected via internal sata connections.

I have also confirmed the directories in the registry and environment variables existed. Would you happen to know the specific files in the directory that UE4 is looking for? Any sort of hash check being performed against those files?

Regarding “Common Tools for Visual C++ 2015” : I swore this was installed on my most recent attempt but I reviewed it just now and it was missing. I modified the installation to include it; however, after it says successfully modified it will still show up missing when I relaunch the VS modifier utility. This may be the source of the issue altogether. I will run additional tests and get back with more information.

The most obvious one: did you right click your uproject and click regenerate project files?

Yes, this does not resolve the issue.
Even when creating a new project (which then changes the option to Generate Visual Studios project files) I am unable to create a C++ class because UE4 cannot detect VS.

Hello Matthew,
Regarding “Common Tools for Visual C++ 2015”: I can now confirm that this properly installed and detected by VS itself. I am unsure what caused the issue with the VS installation utility to not recognized it but it was resolved by doing another clean install, but my guess would be a missing registry GUID as the actual package was certainly there as I was able to use the common tools in Visual Studios.

This still leaves me with UE4 unable to identify VS.

Would you happen to have a list of checks performed by UE4 to determine if VS is installed correctly? I can just hard set the values manually, but I am having trouble finding the information myself.

Unfortunately I don’t. One thing that may help narrow down what we’re missing would be to grab the source build from Github. Of course this requires compiling and you likely won’t be able to do it, but this is all to see what kind of errors the GenerateProjectFiles.bat file gives us. If you haven’t already, you’ll need to link your Epic Games Account to a Github account, download the zip file for the source, extract, run Setup.bat and then try running GenerateProjectFiles.bat. The error given here should shed some light on what is missing.

Hello Matthew Clark, I tried your recommendation, however the GenerateProjectFiles.bat had no issues generating the project files.
I looked into the script (which in turned called another script) and found these parameters for determining vs2015 was installed:

-Does the following path exist and is not empty:

%VsComnToolsPath%

-Does the following file exist

%VsComnToolsPath%/…/…/VC/bin/x86_amd64/vcvarsx86_amd64.bat

Both of which were confirmed in my original posting so it’s not much surprise it succeeded.

It looks like the check performed by this .BAT file and the check performed by the engine post-install are looking for separate things.

Would you happen to at least know which class performs the check? Since I have the source code up anyways I can at least look at it and understand the full criteria of the check.

I found a another check in the code for you:
does ComSpec environment variable point to %SystemRoot%\system32\cmd.exe?

What are the exact errors you are getting from UE4? that might help searching for the location that causes it.

That environment variable does exist and is pointing correctly.
The exact error is in the mega screenshot (top left) in the original post.
If you are looking at the source code directly could you tell me in which class(es) the checks are performed in? I can look as well, but having difficulty identifying it.

Hello treemakesasgame,

I apologize for the delay on this. Through some other users having similar issues to this, it seems that it could be that your Visual C++ Redists are corrupt. Would you be able to reinstall the Visual C++ 2015 Redistributables? You can find them here: Download Visual C++ Redistributable for Visual Studio 2015 from Official Microsoft Download Center

I’ll look into your last question that you asked me and get back to you.

Hello Matthew, I uninstalled and reinstalled both 32 and 64 bit versions of 2015 C++ redistribution using the link you provided. I am still receiving the same error.

Hello treemakesagame,

I apologize for the delay, I was bogged with other reports where people were blocked and figured you were at least able to use source builds in the meantime. After asking some developers that are responsible for this area of the engine, the class that you’re looking for is VisualStudioSourceCodeAccessor.

Hello treemakesagame,

We haven’t heard from you in a while and we haven’t discussed this in a while. Are you still experiencing this issue? If so, please let me know. In the meantime, I’ll be marking this as resolved for tracking purposes.