How can I generate VS files after switching engine version?

After doing right click → Switch Engine Version.

I can no longer generate Visual Studio files for that project.

This is the error I’m getting.

Setting up Rocket project files…
Discovering modules, targets and source code for game…
Errors detected while compiling C:\Users\JNJ\Documents\Unreal Projects\ShooterGa
me\Intermediate\Build\BuildRules\ShooterGameProjectFileGeneratorModuleRules.dll:

c:\Users\JNJ\Documents\Unreal Projects\ShooterGame\Source\ShooterGameEditor.Targ
et.cs(36,48) : error CS0115: ‘ShooterGameEditorTarget.GUBP_GetEditorTests_Editor
TypeOnly()’: no suitable method found to override
UnrealBuildTool Exception: ERROR: UnrealBuildTool encountered an error while com
piling source files
GenerateProjectFiles ERROR: UnrealBuildTool was unable to generate project files
.
Press any key to continue . . .

#Commandline Version

You can use the commandline version instead

"E:\VictoryUE4\UnrealEngine-4.1\Engine\Build\BatchFiles\GenerateProjectFiles.bat" "C:\Users\Rama\Documents\Unreal Projects\VictoryGame\VictoryGame.uproject" -game -engine

I’m going to try to see if that works.

Nope. did not solve. got the same exact error. I believe the shell command does the same exact thing. this is probably an error in the build rules.

Does anyone knows how to solve this?

afaik you may need to use the github version of the engine code build, it also looks if your still using the 4.0.2 version of the demo, you might want to re-download the newer 4.1 build of the game.

you could try using the Unreal Engine\Launcher\Engine\Binaries\Win64\UnrealVersionSelector.exe to set your version then regenerate the vs files then compile in Development Editor mode

I don’t think the 4.0.2 binary and 4.1.0 binary are exclusive, they are diff folder and I can choose to run either in th elauncher.

I don’t think this is the issue as well, as switching engine for some other projects did work. somehow it doesn’t work for this one

#Unresolved

I hope someone can help you with this!

I will send an email to someone at Epic who can help you with this

The GUBP_GetEditorTests_EditorTypeOnly function is being overridden in your ShooterGameEditor.Target.cs file, but it’s been removed from the API for the 4.1 release. UnrealBuildTool compiles these scripts to figure out how to build your game.

If you open the ShooterGameEditor.Target.cs file (it’s in your project’s Source directory), you should be able to delete the function and try again.

If you’re having any other problems updating to the 4.1 release, you might find it helpful to download the updated version of ShooterGame we posted on the marketplace.

Hope that helps!

To fix this: Go create a project using 4.1 or whatever version of UE4 source you are using. Make sure to generate a C++ project. Next, observe your Target.cs and Editor.Target.cs files. Basically, you’d want ShooterGame to have the same functions. What I mean is, when you attempt to Generate Project Files and if you see an error, you’ll need to go to the corresponding .cs file and remove the offending lines of code.

I got my ShooterGame working after fixing the compilation errors one by one. It’s unfortunate the Target.cs files do get migrated when you select a more recent unrealEngine version.