Error when updating to 4.18 (generating visual studio files)

I get an error when upgrading my 4.17.2 project to 4.18, when generating the visual studio files:

Failed to generate project files.

Running C:/Program Files/Epic Games/UE_4.18/Engine/Binaries/DotNET/UnrealBuildTool.exe -projectfiles -project="C:/Users/RyzenAJ/Desktop/ViveShooter/Project_DD_2017/Project_DD.uproject" -game -rocket -progress
Discovering modules, targets and source code for project...
While compiling C:\Users\RyzenAJ\Desktop\ViveShooter\Project_DD_2017\Intermediate\Build\BuildRules\Project_DDModuleRules.dll:
ERROR: c:\Users\RyzenAJ\Desktop\ViveShooter\Project_DD_2017\Source\Project_DD.Target.cs(19,12) : error CS0122: 'UnrealBuildTool.UEBuildBinaryConfiguration' is inaccessible due to its protection level
ERROR: c:\Users\RyzenAJ\Desktop\ViveShooter\Project_DD_2017\Source\Project_DD.Target.cs(17,23) : error CS0051: Inconsistent accessibility: parameter type 'ref System.Collections.Generic.List<UnrealBuildTool.UEBuildBinaryConfiguration>' is less accessible than method 'Project_DDTarget.SetupBinaries(UnrealBuildTool.TargetInfo, ref System.Collections.Generic.List<UnrealBuildTool.UEBuildBinaryConfiguration>, ref System.Collections.Generic.List<string>)'
ERROR: c:\Users\RyzenAJ\Desktop\ViveShooter\Project_DD_2017\Source\Project_DDEditor.Target.cs(19,12) : error CS0122: 'UnrealBuildTool.UEBuildBinaryConfiguration' is inaccessible due to its protection level
ERROR: c:\Users\RyzenAJ\Desktop\ViveShooter\Project_DD_2017\Source\Project_DDEditor.Target.cs(17,23) : error CS0051: Inconsistent accessibility: parameter type 'ref System.Collections.Generic.List<UnrealBuildTool.UEBuildBinaryConfiguration>' is less accessible than method 'Project_DDEditorTarget.SetupBinaries(UnrealBuildTool.TargetInfo, ref System.Collections.Generic.List<UnrealBuildTool.UEBuildBinaryConfiguration>, ref System.Collections.Generic.List<string>)'
ERROR: UnrealBuildTool Exception: Unable to compile source files.

We have the exact same problem too.

Hey Link_AJ-

I tried creating a 4.17 project and converting it but did not run into this error. Is your project a code/blueprint project? Are you using the binary engine from the launcher or a source built engine? Does this occur during the conversion process or when trying to open the project after converting. If you’re able to reproduce the error in a new project, please also include the reproduction steps to help investigate.

It looks like some things might have not been converted a while ago and they are causing issues with conversions to 4.18.

Change these files:

YourProject\Source\YourProject\YourProject.Build.cs
YourProject\Source\YourProject\YourProject.Target.cs
YourProject\Source\YourProject\YourProjectEditor.Target.cs

Follow the recommendations from roman94v here: [forum][1]

The SetupBinaries() method is no longer needed.

I can confirm that these steps fixed the problem for us. Big thanks!

this worked, thanks you saved the project :slight_smile:

Just leaving this here for anyone in the same position as me. I was having issues upgrading from 4.16 to 4.18. The fix above only worked after first converting to 4.17. Then I made the changes you listed and fixed the issue completely. Thanks for your help!

Worked for me too - Thanks So Much!!!

I have this problem, too, with all my projects, across the board. Projects created with 4.15 and 4.16. Source build from 4.15, 4.16 and 4.18 tags on GitHub. C++ empty project templates used. The message box that pops up contains random build messages but not the error message. After one attempt at compiling, attempting to open the project or issuing ‘make’ doesn’t do anything anymore, so I need to delete libUE4Editor-ProjectName.so by hand for another shot. Very poor error handling and recovery.

Worked for me. 4.14->4.18 upgrade.

Quick addition to the selected answer:

For newer UE versions, the paths are these:

    YourProject\Source\YourProject\YourProject.Build.cs 
    YourProject\Source\YourProject.Target.cs 
    YourProject\Source\YourProjectEditor.Target.cs

Thanks, this worked for me on first attempt which is a rarity on many issues of UE4…!

Works for 4.15 → 4.18 using the new paths in Art-McLabin’s answer. I think the project upgrader should try to do that conversion if it’s easy to do, and if it’s not because the user has modified the files and it would create conflicts, it should warn the user and let him/her solve the conflict.

Thanks worked for me 4.16 → 4.18

OMG THANK YOU SO MUCH DUDE! I have to get up in about 5 hours to get to work but i just want to say a huge thank you for this, i was losing my mind so much because of this!

works 4.10 → 4.19, you are my hero !

edit, solved

I have done all of this and I am still getting as my first error: ‘unrealbuildtool.uebuildbinaryconfiguration’ is inaccessible due to its protection level… is there something else I am missing, trying to update from 4.17 to 4.18

nevermind, it worked, i just did not delete all the parts that were in red in the images, deleting those parts solved it… the fact i tried this at 2:30 am and tired might not have helped me…

thank you so much UE4 community!

I confirm it worked too on 4.19.2. Thank you!..

please mention you’ve sovled it in the first line when you edit, otherwise people waste their lifetime reading whole the text until they realise it’s nvm

confirmed from 4.17 to 4.2.2