BuildConfiguration is inaccessible in 4.19

Trying to generate project files against 4.19 I get:

error CS0122: 'UnrealBuildTool.BuildConfiguration' is inaccessible due to its protection level

This is from a plugin bulid.cs with the following code:

Path.GetFullPath(BuildConfiguration.RelativeEnginePath)

It seems UnrealBuildTool.BuildConfigiration is no longer accessible from build.cs files? What is the correct way to get things like RelativeEnginePath in 4.19?

1 Like

Figured it out:
These are now exposed through properties of the ReadOnlyTargetRules Target argument

1 Like

So what exactly was the problem can you give the example.(Where you want to add the code )

How to do it in details

Please tell me how to do it in detail,i don’t kown how to exposed through properties,thank you!

Change this:

Path.GetFullPath(BuildConfiguration.RelativeEnginePath)

To this;

Path.GetFullPath(Target.RelativeEnginePath)

Where Target is the ReadOnlyTargetRules argument passed into the constructor.

2 Likes

thanks alot! i’ve been trying to get it working for 2 weeks.
and also for

string PluginPath = Utils.MakePathRelativeTo(ModuleDirectory, BuildConfiguration.RelativeEnginePath);

you can change it into

string PluginPath = Utils.MakePathRelativeTo(ModuleDirectory, Target.RelativeEnginePath);

to fix that issue :smiley:

1 Like