I am using the Azure Devops pipeline. From 2020/6/25, an error has occurred.
task:dotnet test Error: The framework'Microsoft.NETCore.App', version '2.2.0' was not found.
What I care about: When it was successful, the following display.
Welcome to .NET Core 3.1!
---------------------
SDK Version: 3.1.300
Tasks when it starts to fail:
Welcome to .NET Core 3.1!
---------------------
SDK Version: 3.1.301
The dotnet test portion of the Yml file is as follows version was used before the error. Added minorVersion and patchVersion, but they did not work. I added the x86 version of arguments, but it didn't work either.
pool:
vmImage: 'windows-latest'
variables:
solution: '**/TamaWeb.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
# disable.coverage.autogenerate: 'true'
steps:
- task: NuGetToolInstaller@0
inputs:
versionSpec: '>=5'
checkLatest: true
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
- task: VSBuild@1
inputs:
solution: '$(solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactStagingDirectory)\WebApp.zip" /p:DeployIisAppPath="Default Web Site"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
task: DotNetCoreCLI@2
displayName: dotnet test
inputs:
command: test
# test core version
# version: '2.2'
majorVersion: '3'
minorVersion: '1'
patchVersion: '300'
arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --runtime win-x86'
projects: '**/*[Tt]est/*[Tt]est.csproj'
# projects: '**/*Test/TamaCoreTest.csproj'
nobuild: true
csproj file:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="2.8.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.5" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.ViewFeatures" Version="2.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Moq" Version="4.14.1" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.1" />
<PackageReference Include="NLog" Version="4.7.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\XXX\AAA.csproj" />
<ProjectReference Include="..\XXX\BBB.csproj" />
<ProjectReference Include="..\XXX\CCC.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="appsettings.test.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ProjectExtensions><VisualStudio><UserProperties appsettings_1test_1json__JsonSchema="" /></VisualStudio></ProjectExtensions>
</Project>
Is it possible to specify the above SDK version with the dotnet test task? If you know another solution, please help.