Tencent / puerts

PUER(普洱) Typescript. Let's write your game in UE or Unity with TypeScript.
Other
5.01k stars 699 forks source link

[UE] Bug: rider下直接编译工程,会有The "CheckIfPackageReferenceShouldBeFrameworkReference" task could not be loaded的报错 #1849

Open cgsgood opened 5 days ago

cgsgood commented 5 days ago

前置阅读 | Pre-reading

Puer的版本 | Puer Version

git上的最新版本

UE的版本 | UE Version

UE 5.4.2

发生在哪个平台 | Platform

Editor(win)

错误信息 | Error Message

Microsoft.NET.Sdk.DefaultItems.Shared.targets(80,5): Error MSB4062 : The "CheckIfPackageReferenceShouldBeFrameworkReference" task could not be loaded from the assembly C:\Program Files\dotnet\sdk\8.0.107\Sdks\Microsoft.NET.Sdk\targets..\tools\net8.0\Microsoft.NET.Build.Tasks.dll. Could not load file or assembly 'System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. 系统找不到指定的文件。 Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. (H:\UEProj\puerts_unreal_demo\Plugins\Puerts\Source\CSharpParamDefaultValueMetas\CSharpParamDefaultValueMetas.ubtplugin.csproj)

11>Microsoft.NET.TargetFrameworkInference.targets(138,5): Error MSB4062 : The "AllowEmptyTelemetry" task could not be loaded from the assembly C:\Program Files\dotnet\sdk\8.0.107\Sdks\Microsoft.NET.Sdk\targets..\tools\net8.0\Microsoft.NET.Build.Tasks.dll. Could not load file or assembly 'System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. 系统找不到指定的文件。 Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. (H:\UEProj\puerts_unreal_demo\Plugins\Puerts\Source\CSharpParamDefaultValueMetas\CSharpParamDefaultValueMetas.ubtplugin.csproj)

问题重现 | Bug reproduce

1、下载puerts_unreal_demo工程,并配置一切需要的依赖,用UE 5.4.2(源码版)生成 .sln文件 2、直接用rider 2024.2.4 打开工程后,直接编译puerts_unreal_demo工程,则会报上述错误

BlurryLight commented 5 days ago

算是Rider自身的问题吧,通常是由于电脑安装了高版本的DotNet环境,导致Rider会自动寻找到高版本的Dotnet。 修改Rider的设置,改到虚幻自带的DotNet就可以了。 image