4.7 Added classes not showing in Solution Explorer

Hi ! :slight_smile:

Branch : Binary build from the Unreal Launcher

Build version : 4.7

Repro steps :

  • Open Unreal Editor via Epic Game Launcher (Not using a self made version from git).
  • Create a new “C++ Basic Code” project.
  • Go under File → Add Code to Project and create a new class inherited from Character.
  • The Editor then creates the class, compiles project, and open the files in VS. No problem with that.
  • Problem is that new classe’s files are NOT shown in the solution explorer.

Detailed description of the issue :
It seems i can use them anyway, and i still can open them from the Editor, or include the header file in other files like the gamemode, but still…

I tried to locate the files and they are where they should be (Source/[ProjectName]/).

Weirder : Now that i have added my custom class, if i try to close VS, it asks me if i want to save the changes i made in my project. And if i say yes, it asks me where i want to save a vcxproj file (Default is Intermediate/ProjectFiles/[ProjectName].vcxproj) and show no vcxproj file already existing in the said folder.

Yet, if i don’t change the name or directory made by default and want to save, it tells me that there is already a file with that name and asks me if i want to overwrite…

Trying to overwrite the file results in a very helpful “One or more errors occured” message.

Trying to save the file with another name results in the following message : “The method or property “VCProjectShim::put_ProjectFile” is deprecated and no longer implemented.

So i’m a bit forced to exit VS without saving.

Hey, which version of VS are you using? (eg, VS2013 Pro).

We now try and use DTE to inject newly added source files straight into the open VS instance (to avoid the annoying modal popup about having to re-load the project/solution).

It’s possible that this is failing somehow, but it should fallback to the project generation method if that happens.

I’m going to take a look into the saving issue, as I’ve noticed that myself. It might just be a case of us saving the solution after we’ve inserted the new files.

Hi Jamie.

I’m using VS2013Ultimate.
It’s good to know i’m not the only one having this issue, is was starting to think i was cursed. :smiley:

The only thing i have changed on my computer is that i installed the trial version of Visual Assist. I’ll try to uninstall it and see how it goes.

I’ve tried this myself using VS2013 Pro, and VS2013 Ultimate, however I’ve not had any issues with the newly added classes appearing in the solution explorer.

On the plus side, I’ve fixed the save issue in eca36d57d7ce6d0d1538ed961a99575dc9802eb3. We now save the project after adding the new files to it.

Just to rule out any differences in our setups, does your Windows user account have admin rights, and are VS and UE4 both running as the same user?

Hey.

Thanks for the fix !

Yes i have admin rights. VS and UE4 are using my account (checked via the task manager).

Turns out that Visual Assist was the problem -_-

After uninstalling it, i created a new project and everything went fine. Solution explorer was updated with my new classes, and even the “vcxproject file” problem didn’t occur.

Just to be sure, i installed it again, tried the same steps as above, and both issues came back.

Yes it was the latest version.

Curious. Which version of Visual Assist was that? (I assume the latest - 2059, built 2015.02.11).

I have Visual Assist on both the machines I tested with, although admittedly an older version (2048, built 2014.09.22).

I’ve just tried this with the latest VAX build, however it’s still working as expected for me.

When this happens to you, do you get any warnings in the UE4 Output Log? (Window → Developer Tools → Output Log).

If you have the source code available, you could take a look in VisualStudioSourceCodeAccessor.cpp. It’s the FVisualStudioSourceCodeAccessor::AddSourceFiles function which adds the new files to the project, and the CurProjectItems->AddFromFile call that actually tries to add the new file via DTE. Is that running okay when adding the new files?