could not be compiled. Try rebuilding from source manually.

Hello,

After a migration from UE4. I have a big issue. I have spend a lot of hours on it.

I use UE 5.6.1. I have try with a blanck test project and it works fine. So I think I have an error in my project.

I have compare the .cs and file in source folder between the two project and I see no difference. I have disable all plugin in the uasset file project (except one).

I have try all possibilities. Delete derivedcache/save/intermediate/.vs/bin/build folders.

Regenerate a sln file, build with vs20222. And try again to launch my project.

So the steps are after clean all and launch the project :

  1. I click YES to disable the plugin :

  1. I click yes to rebuild

The following modules are missing or built with a different engine version:

  1. I click OK on the error message

AgeOfAlbuvia could not be compiled. Try rebuilding from source manually.

  1. I right click on generate Visual Studio Project files

5.

5. The file are correcly created.

  1. I Clic on Build solution in VS 2022 (developpment, Win64) :

Note I have two warnings at startup :

D:\DEV\Unreal Engine\Projects\AOA_UE5\depot_AOA\Intermediate\ProjectFiles\UE5.vcxproj : warning : The build tools for Visual Studio 2022 (v143) cannot be found. Install Visual Studio 2022 (v143) to build using the Visual Studio 2022 (v143) build tools.

D:\DEV\Unreal Engine\Projects\AOA_UE5\depot_AOA\Intermediate\ProjectFiles\UE5.vcxproj : warning : Platform ‘Win64’ referenced in the project file ‘UE5’ cannot be found.

Note I have errors : warning NU1902: Package ‘Magick.NET-Q16-HDRI-AnyCPU’ 14.7.0 has a known moderate severity vulnerability, https://github.com……

So I update the package, clean solution an rebuild solution again.

  1. After update the package, the build is correct :

========== Build: 51 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

  1. I start again my project with the same warning (I click yes before to disable the plugin) :

  1. I clic Yes but always the same error :

The following modules are missing or built with a different engine version:

AgeOfAlbuvia

Would you like to rebuild them now?

First Question, how it know there is a UE4 project ? Because the issue must be there.

Can someone have an idea to identify where the issue is located ?

More information for the manual command line build :

Note I have unistalled and make a fresh install of UE 5.6.1 Engine.

My source Files :

image

My AgeOfAlbuvia.Build.cs

// Fill out your copyright notice in the Description page of Project Settings.

using UnrealBuildTool;

public class AgeOfAlbuvia : ModuleRules
{
	public AgeOfAlbuvia(ReadOnlyTargetRules Target) : base(Target)
	{
		PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
	
		PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });

		PrivateDependencyModuleNames.AddRange(new string[] {  });


	}
}

My AgeOfAlbuviaTarget.cs (in UE4 it was AgeOfAlbuvia.Target.cs) :

// Fill out your copyright notice in the Description page of Project Settings.

using UnrealBuildTool;
using System.Collections.Generic;

public class AgeOfAlbuviaTarget : TargetRules
{
	public AgeOfAlbuviaTarget(TargetInfo Target) : base(Target)
	{
		Type = TargetType.Game;
		DefaultBuildSettings = BuildSettingsVersion.V5;

		ExtraModuleNames.AddRange( new string[] { "AgeOfAlbuvia" } );
	}
}

My AgeOfAlbuviaEditorTarget.cs (in UE4 it was AgeOfAlbuviaEditor.Target.cs) :

// Fill out your copyright notice in the Description page of Project Settings.

using UnrealBuildTool;
using System.Collections.Generic;

public class AgeOfAlbuviaEditorTarget : TargetRules
{
	public AgeOfAlbuviaEditorTarget(TargetInfo Target) : base(Target)
	{
		Type = TargetType.Editor;
		DefaultBuildSettings = BuildSettingsVersion.V5;

		ExtraModuleNames.AddRange( new string[] { "AgeOfAlbuvia" } );
	}
}

  1. If I try to build manually I have this error message :

D:\DEV\Unreal Engine\Projects\AOA_UE5\depot_AOA\Source\AgeOfAlbuvia\AgeOfAlbuvia.Build.cs(5,14): error CS0101: The namespace ‘’ already contains a definition for ‘AgeOfAlbuvia’
D:\DEV\Unreal Engine\Projects\AOA_UE5\depot_AOA\Source\AgeOfAlbuvia\AgeOfAlbuvia.Build.cs(7,9): error CS0111: Type ‘AgeOfAlbuvia’ already defines a member called ‘AgeOfAlbuvia’ with the same parameter types
Couldn’t find target rules file for target ‘Age_Of_AlbuviaEditor’ in rules assembly ‘UE5Rules, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’
Location: D:\DEV\Unreal Engine\Engine\UE_5.6\Engine\Intermediate\Build\BuildRules\UE5Rules.dll

I see in logs :

Compiled assembly file ‘D:\DEV\Unreal Engine\Projects\AOA_UE5\depot_AOA\Intermediate\Build\BuildRules\AgeOfAlbuviaModuleRules.dll’ appears to be for a newer CLR version or is otherwise invalid. Unreal Build Tool will try to recompile this assembly now. (Exception: Bad IL format. The format of the file ‘D:\DEV\Unreal Engine\Projects\AOA_UE5\depot_AOA\Intermediate\Build\BuildRules\AgeOfAlbuviaModuleRules.dll’ is invalid.

And the dll files have 0 Ko :

My error is to rrename AgeOfAlbuviaEditorTarget.cs and AgeOfAlbuviaTarget.cs

I have rename to original names AgeOfAlbuviaEditor.Target.cs and AgeOfAlbuviaEditor.Target.cs

It’s good now

1 Like