我们有一个Azure函数应用程序项目,它使用.NET8RC2 SDK在本地构建得很好.但是,当通过Azure管道构建时,它在还原NuGet包步骤期间失败,并引发以下错误:
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.CommandLine.RestoreCommand.<DetermineInputsFromMSBuildAsync>d__63.MoveNext()
##[error]The nuget command failed with exit code(1) and error(D:\a\1\s\some.API.csproj : error : Could not resolve SDK "Microsoft.NET.Sdk".
Exactly one of the probing messages below indicates why we could not resolve the SDK. Investigate and resolve that message to correctly specify the SDK.
D:\a\1\s\SOME.API.csproj : error : Unable to locate the .NET SDK. Check that it is installed, your PATH is configured for the correct architecture, and that the version specified in global.json (if any) matches the installed version.
D:\a\1\s\SOME.API.csproj : error : The NuGetSdkResolver did not resolve this SDK because there was no version specified in the project or global.json.
D:\a\1\s\SOME.API.csproj : error : MSB4276: The default SDK resolver failed to resolve SDK "Microsoft.NET.Sdk" because directory "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Sdks\Microsoft.NET.Sdk\Sdk" did not exist.
D:\a\1\s\SOME.API.csproj : error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found. No .NET SDKs were found.
在此之前的步骤中,成功下载了.NET 8.0.x SDK,并为"使用.NET核心"任务步骤启用了"包含预览版本".
你知道这个错误的原因是什么吗?