I attempted to create a new target file in my game project that looks something like the repro steps. The modules compiled successfully, but loading failed, with an error that the runtime couldn’t find UE5ProgramRules.dll. I ran it through dotnet-trace, and found that the problem is that loading is failing because a) UE5ProgramRules.dll (and all other dlls) are not cached in the AppDomain, so fresh loads are always attempted for dependencies, and b) Because UE5ProgramRules.dll is in Engine/Intermediate/ and MyProjectRules.dll is in MyProject/Intermediate/, side-by-side module loading rules don’t apply. Do you have any suggestions for making this work, or should I just copy-paste the content of UnrealInsights.Target.cs and carry on?
Steps to Reproduce
Create a file called MyInsights.Target.cs in any game project Source directory with the following content, and run GenerateProjectFiles.bat:
`using UnrealBuildTool;
using EpicGames.Core;
[SupportedPlatforms(“Win64”, “Linux”, “Mac”)]
public class MyInsightsTarget : UnrealInsightsTarget
{
public MyInsightsTarget(TargetInfo Target) : base(Target)
{
}
}`
Hey there Colden,
Thanks for your patience as the team has been attending a conference last week. So I would not generally recommend inheriting from other Rules, outside of specifically those contained . Generally speaking you want to inherit from the TargetRules contained within the UBT namespace, and I’d suggest this as the primary path forward (and as you’ve annotated, copy contents) as it’s the path well exercised and expected for Rules definition.
I can bring this use case up with the SME to see if this is something that could be supported in the future, as it’s currently not supported.
Julian