Getting an "Failed to generate code project files"

When I try to generate a new C++ template shooter I get the following error: “Failed to generate code project files for C:\Documents\Unreal Projects\MyProject.uproject”.

I have done some research and I suppose the problem is that UE4 cannot find where my VS2013 is installed on my computer. Is there a way to tell the engine where to find my VS2013 when it attempts to generate a new project?

Hi timetravel,

There are a few things you can check. First search your Registry for InstallDir. There should be a registry key for this located in your Visual Studio keys in the registry. Make sure this is pointing to the ...\Common7\IDE\ folder of your Visual Studio installation.

Also, check your Environment Variables for a variable named VS120COMNTOOLS. This variable should point to the ...\Common7\Tools\ folder of your Visual Studio installation.

If neither of these work, try repairing your Visual Studio installation, or you can uninstall and re-install Visual Studio (it is usually a good idea to reboot after both steps if you go that route).

I looked up both of these registry keys and they were pointing to what you said. I tried re-installing both VS2013 and UE4 and I also tried using the express edition of visual studio 2013 but I am still getting the same error. I use the same version of VS2013 on my laptop and it works just fine with UE4.

Hi timetravel,

Do you happen to have any other versions of Visual Studio installed as well?

I found what the problem was. I indeed also had visual studio 2012 installed on my computer. This time I uninstalled both versions of visual studio and UE4. I installed VS2013 first and then I re-installed UE4 after that so now it works! It appears that VS2012 was causing the issue.

Thanks!