UnrealVS "Refresh Project Files" button is greyed out

The “Refresh project files” button in UnrealVS is always greyed out, no matter what I do. This happens on all of my projects, both on my two personal computers and on the computer at my office. My coworkers have the same problem.

Versions of the engine are 4.10 and 4.11.

Hi ,

The refresh projects button is only enabled if three conditions are met:

  • A solution is open.
  • The solution file was generated by the UnrealBuildTool.
  • The solution file is located in the same folder as the GenerateProjectFiles.bat file for the Engine.

The first two conditions are very likely being met when you are looking at the UnrealVS toolbar. The third condition is typically the one that determines if the Refresh Project button is enabled. In order for the third condition to be met, the project must have been created in the Engine’s root folder, and use the Engine’s solution file to work with its source code. Projects created in this location do not have their own solution files, so the UnrealVS Refresh Projects button is important here.

If you created your project file in a location that is different from the Engine root folder (which is very common), you can perform essentially the same function with both Visual Studio and the Editor closed, by right-clicking on the .uproject file and selecting the Generate Visual Studio project files option.

This is still less convenient than having a button directly in the IDE.

It may not be what the button is for, but it would be handy for it to work with normal projects nonetheless.

Hi ,

I agree with @.
I believe “Generate Visual Studio project files” has no regard to the location of .uproject file.
And .uproject file could be found simply as replacing the extension of solution file from .sln to .uproject.
Why doesn’t UnrealVS call “Generate Visual Studio project files” for .uproject file instead of calling GenerateProjectFiles.bat?

Won

Hi Won,

Sorry for not responding sooner. The UnrealVS extension is a tool that was originally created for use internally. We ended up deciding to release it publicly since it adds some helpful Unreal-specific functionality to Visual Studio. Unfortunately it is not being actively developed, other than to provide an occasional bug fix or update for a new version of Visual Studio. The Refresh Projects button specifically was added to the tool because that is the only way to refresh a project that is located within the root Engine directory. For projects that are not located in the root Engine directory, the expected workflow is to use the Generate Visual Studio project files option in the .uproject file’s context menu (which does not actually create a project solution file when the project is in the root Engine directory).

I can understand there being some annoyance with having two different options for refreshing project files depending on where the project is located. Unfortunately there are no current plans to unify these two options into a single process.

I can’t fix the greyed out button, but for those who are happy with a work around, you can add your own button to implement what I assume to be the same feature to look like this:

289406-annotation-2019-10-07-225741.png

Before you ask, I don’t know how to make it an icon - I had a brief look then gave up as soon as I saw a reference suggesting I implement an icon for the button using the Visual Studio SDK.

Step 1: Add your own GenerateProjectFiles.bat in the same directory as your .uproject file. Should look like this:

You can either use the quoted full path for UnrealBuildTool.exe (gross), or just do what I did and just add that directory to your PATH environment variable. At this point you should stop and test the batch file is working by running it in your File Explorer. To debug any issues, run the batch file from Command Prompt and read the output.

Step 2: Create a new External Tool in Visual Studio. This is under Tools → External Tools. Make it like this:

289407-annotation-2019-10-07-230010.png

This just creates a command that executes the batch file you wrote from inside Visual Studio. Command Prompt will execute the batch file, running it from your solution directory (which is where your .uproject should be). Checking the Output Window tick box will allow you to see the progress of the batch file in real-time as it prints out log messages in Visual Studio.

Step 3: Add your new External Tool to the UnrealVS toolbar (or anywhere you want, doesn’t matter). To add it to the UnrealVS toolbar, follow these images:

289409-annotation-2019-10-07-230455.png

IMPORTANT External Tools are named “External Command X” in the Add Command window. To know which number you should pick, count down from the top of the External Tools list starting from 1. Because I don’t know/like any of the other default tools in the list, I just delete them to save me the effort.

1 Like