Unable to build unreal engine from source (Nuget package issues?)

After downloading the source code, installing visual studio and required packages and running setup.bat and then trying to run GenerateProjectFiles.bat, I’m getting errors with nuget packages being incompatible with net6.0:

D:\UnrealEngine\Engine\Source\Programs\Shared\EpicGames.Serialization\EpicGames.Serialization.csproj : error NU1202: Pa
ckage OpenTracing 0.12.1 is not compatible with net6.0 (.NETCoreApp,Version=v6.0). Package OpenTracing 0.12.1 does not
support any target frameworks. [D:\UnrealEngine\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.csproj]
D:\UnrealEngine\Engine\Source\Programs\Shared\EpicGames.IoHash\EpicGames.IoHash.csproj : error NU1202: Package OpenTrac
ing 0.12.1 is not compatible with net6.0 (.NETCoreApp,Version=v6.0). Package OpenTracing 0.12.1 does not support any ta
rget frameworks. [D:\UnrealEngine\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.csproj]
D:\UnrealEngine\Engine\Source\Programs\Shared\EpicGames.Core\EpicGames.Core.csproj : error NU1202: Package OpenTracing
0.12.1 is not compatible with net6.0 (.NETCoreApp,Version=v6.0). Package OpenTracing 0.12.1 does not support any target
 frameworks. [D:\UnrealEngine\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.csproj]
D:\UnrealEngine\Engine\Source\Programs\Shared\EpicGames.Box\EpicGames.Box.csproj : error NU1202: Package Microsoft.Win3
2.Registry 5.0.0 is not compatible with net6.0 (.NETCoreApp,Version=v6.0). Package Microsoft.Win32.Registry 5.0.0 does
not support any target frameworks. [D:\UnrealEngine\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.csproj]
D:\UnrealEngine\Engine\Source\Programs\Shared\EpicGames.Box\EpicGames.Box.csproj : error NU1202: Package System.Securit
y.AccessControl 5.0.0 is not compatible with net6.0 (.NETCoreApp,Version=v6.0). Package System.Security.AccessControl 5
.0.0 supports: uap10.0.16299 (UAP,Version=v10.0.16299) [D:\UnrealEngine\Engine\Source\Programs\UnrealBuildTool\UnrealBu
ildTool.csproj] ....

In order to start from a clean slate, I reinstalled my windows OS and repeated above steps to no avail. This is currently what shows as installed on my system:

dotnet --list-sdks
8.0.204 [C:\Program Files\dotnet\sdk]

dotnet --list-runtimes
Microsoft.AspNetCore.App 8.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 8.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

What is going on and how do I fix this? Any help would be appreciated

Edit:

I also receive this warning concerning packages being restored using .netframework versions other than ‘net6.0’:

D:\UnrealEngine\Engine\Source\Programs\Shared\EpicGames.Box\EpicGames.Box.csproj : warning NU1701: Package 'System.Data
.DataSetExtensions 4.5.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework
,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the p
roject target framework 'net6.0'. This package may not be fully compatible with your project. [D:\UnrealEngine\Engine\S
ource\Programs\UnrealBuildTool\UnrealBuildTool.csproj]

I noticed the cproj files (ex. UnrealEngine\Engine\Source\Programs\Shared\EpicGames.Box.csproj) within the unreal engine source list ‘net6.0’ in the targetframework field:

<PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>

is this incorrect?

Hi ! I 'm having a similar issue right now. I already had the engine built, I was working on my project, and I started getting errors about incompatibility with net6.0 out of the blue. (I seemingly didn’t touch anything related)

I tried to rebuild the engine, had to change the version of

<PackageReference Include=“Microsoft.Extensions.Logging.Console” Version=“5.0.0” / >
in
UnrealEngine\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.csproj

to get past the same kind of error as the OP, but I get this when trying to build my project :

Failed to restore \UnrealEngine\Engine\Source\Programs\Shared\EpicGames.MongoDB\EpicGames.MongoDB.csproj (in 30 ms).
Failed to restore \UnrealEngine\Engine\Source\Programs\Shared\EpicGames.Redis\EpicGames.Redis.csproj (in 79 ms).
Failed to restore \UnrealEngine\Engine\Source\Programs\AutomationTool\SmartlingLocalization\SmartlingLocalization.Automation.csproj (in 230 ms).

// And many more...

1>------ Build started: Project: ****, Configuration: Development_Editor x64 ------
Failed to restore \UnrealEngine\Engine\Source\Programs\Shared\EpicGames.Perforce.Fixture\EpicGames.Perforce.Fixture.csproj (in 77 ms).
NuGet package restore failed. Please see Error List window for detailed warnings and errors.
1>Using bundled DotNet SDK version: 6.0.302

Using the dotnet restore command results in :

UnrealEngine\Engine\Source\Programs\Shared\EpicGames.MongoDB\EpicGames.MongoDB.csproj : error NU1202: Package AWSSDK.SecurityToken 3.7.100.14 is not compatible with net6.0 (.NETCoreApp,Version=v6.0). Package AWSSDK.SecurityToken 3.7.100.14 does not support any target frameworks. [E:\SpaceHex\HexD-Space\HexD_Space.sln]

with this same error for many different “systems”.

I spent hours looking for a solution but I don’t really understand what’s happening and couldn’t find anything :confused:

For an update for my situation I ended up re-downloading the unreal engine source but downloaded it to a different drive (my C:/ drive. Originally, I downloaded it to my D:/ drive). I repeated my steps above and generateprojectfiles.bat finally worked. It seems like unreal source expects to be downloaded to the C:/ drive? I’m not sure why yet but will continue to investigate and see if this can be changed. In my mind the engine should be able to be downloaded to any drive

Hi @Boagz I wasn’t sure when I saw your post but your report suggest that through your download files got corrupted, or perhaps a hard drive issue? I had the problem of damaged downloaded files from downloading through the DOS panel. Since, I download directly via GitHub without problems so far.

Hmm, maybe? I did just download to my laptop and was able to run GenerateProjectFiles.bat without much issue (a couple warnings but still completed). I would have to look a bit more into it to confirm