Why is the "Add code to project" menu item null?

The problem: File menu item “Add code to project” appears unselectable though visual studio (express '13) is installed.



I’ve attempted to research the issue though I was unable to find any hits. How should I go about correcting this?

OS: Windows 7, 64bit
Engine version: 4.0.2

Additional information:
VS was installed after UE4’s complete installation.
I’ve installed various other versions of VS throughout time though they were uninstalled prior to installing UE4 and VS Exprs. 2013.
No conflicts noted during installation.

Does your %VS120COMNTOOLS% environment variable point to somewhere such that “%VS120COMNTOOLS%/…/IDE/WDExpress.exe” is a valid path?

You could also take a look inside the VSAccessor module and verify that the CanRunVisualStudio function is returning true.

Did you figure this out yet? I have exactly the same problem :frowning:

Hey SMillard,

Did you check Jamie’s answer, below?

That should be set to “C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools”.

Yes, my environment variable is set to: “C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\WDExpress.exe” (the correct path). But I don’t exactly know what the VSAccessor module is…

huh… that’s actually what it was set to by default, but I changed it to the above because that’s what I thought your answer below indicated. Anyway, now I changed it back to “C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools”, and the option is still grayed out :frowning:

Ah, no, I meant that the following should be a valid path (for VS2013 Express anyway):

So to resolve that out:
“C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7/…/IDE/WDExpress.exe”

And to collapse it down:
“C:\Program Files (x86)\Microsoft Visual Studio 12.0\IDE\WDExpress.exe”

Which is correct :slight_smile:

Are you building from source? If you look in the UE4 source there will be file called VSAccessorModule.cpp, and inside that is a function called CanRunVisualStudio. I believe (hope) that is the function that controls the enabled state of that menu item.

Could you see what it’s returning in your case? Thanks.

I only have the header file (VSAccessorModule.h) - I’m not building from source, I just downloaded “UnrealEngineInstaller-1.0.0-2039063” and installed Unreal Engine through the Launcher. On my Mac it worked fine to just download and install that way. I guess I’ll try building from source and see if that makes a difference. Thanks for all your help man :slight_smile:

I apologize for the delay in response.

Yes, the path is accessible. I found the VSAccessor module you mentioned though unfortunately I’ve not had much time to familiarize myself with the language enough to debug for a result. Is there an alternative to further investigating this?

Update: Apparently I overlooked the directory, it was pointing to %VS120COMNTOOLS%/common7/TOOLS/, rather than …/IDE/.

Thank you. It helps to double check yourself once in awhile haha.

It should be set to “C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools” (assuming that actually exists depending on where you installed it).

I meant that the following should be a valid path (for VS2013 Express anyway): “%VS120COMNTOOLS%/…/IDE/WDExpress.exe”

So to resolve that out: “C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7/…/IDE/WDExpress.exe”

And to collapse it down: “C:\Program Files (x86)\Microsoft Visual Studio 12.0\IDE\WDExpress.exe”

I just wonder what made it work for you though… I still haven’t got it working (gonna try building from source later today, but still I don’t see why that should make a difference)…

Gotcha. Either way we got it working, thank you once again Jamie.

The reason it wasn’t working for me is because the environment variable was pointing to “…\Microsoft Visual Studio 12.0\Common7/tools/”, though the directory does exist, the executable simply isn’t there.

Why it was pointing there to begin with is beyond me, but that was my findings.

I set the environment variable to point toward “”…\Microsoft Visual Studio 12.0\Common7/IDE/" as Jamie suggested and it now works as intended.

That really should be pointing to the Tools folder, it will work where you have it but may break other things inside Visual Studio that try and access things from within that folder.

It will go one level up from wherever that environment variable points to, then down into IDE, so having it set to “Microsoft Visual Studio 12.0\Common7/IDE/” becomes “Microsoft Visual Studio 12.0\Common7/IDE/…/IDE”, which resolves to “Microsoft Visual Studio 12.0\Common7/IDE/”.

By that logic “Microsoft Visual Studio 12.0\Common7/Tools/” becomes “Microsoft Visual Studio 12.0\Common7/Tools/…/IDE” which also resolves to “Microsoft Visual Studio 12.0\Common7/IDE/”.

Note that you need to restart Visual Studio after changing an environment variable for the changes to have any effect.

For me it didn’t work, because for some reason my Visual Studio 2013 Express instalation didn’t make a WDExpress.exe, but a VSWinExpress.exe application. Copying and renaming proved that it isn’t VSWinExpress.exe what I’m looking for.

You definitely installed Visual Studio Express for Windows Desktop? Download Visual Studio Tools - Install Free for Windows, Mac, Linux

That exe name sounds like you might have installed Visual Studio Express for Windows, which is similarly named, but unfortunately, not correct.

None of these fixes work for me. I have tried setting my %VS120COMNTOOLS% environment variable to:

D:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\

D:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\

D:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools

And nothing helps.

Yes I have WDExpress.exe installed at: D:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\WDExpress.exe

Any other suggestions?

What version of UE4 are you using, and are you using a launcher build?

If you’re using launcher built version >= 4.10 then you’ll need VS2015, not VS2013. The corresponding environment variable for VS2015 is %VS140COMNTOOLS%.