在我的解决方案中,我有针对 .netstandard 2.0 的项目,因为我们不能有针对同一平台的测试用例项目,所以我正在使用 .netcore 3.1 单元测试项目,即使在我将构建管道更新为使用 .net 3.1 之后,我也面临以下问题在构建管道中恢复 nuget 步骤时出现问题。
##[error]The nuget command failed with exit code(1) and error(C:\Program Files (x86)\Microsoft Visual Studio\2017\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.TargetFrameworkInference.targets(112,5): error : The current .NET SDK does not support targeting .NET Core 3.1. Either target .NET Core 1.1 or lower, or use a version of the .NET SDK that supports .NET Core 3.1. [D:\a\1\s\src\SampleProject\test\UnitTest\UnitTest.csproj])
##[error]Packages failed to restore
注意:https ://www.hanselman.com/blog/AzureDevOpsContinuousBuildDeployTestWithASPNETCore22PreviewInOneHour.aspx 是我用来解决此问题但仍面临相同错误的链接。