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

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

Reference:

http://puu.sh/7XTjG.png

I’ve attempted to research 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 VSAccessor module and verify that CanRunVisualStudio function is returning true.

Did you figure this out yet? I have exactly 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” (correct path). But I don’t exactly know what VSAccessor module is…

huh… that’s actually what it was set to by default, but I changed it to 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 option is still grayed out :frowning:

Ah, no, I meant that 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”

Which is correct :slight_smile:

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

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

I only have header file (VSAccessorModule.h) - I’m not building from source, I just downloaded “UnrealEngineInstaller-1.0.0-2039063” and installed Unreal Engine through 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 delay in response.

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

Update: Apparently I overlooked 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 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.

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

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

I set 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 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 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. corresponding environment variable for VS2015 is %VS140COMNTOOLS%.