当我运行 dotnet 测试任务时,测试运行正确,但是在生成 xml 格式的报告文件时,出现以下错误:
/home/adminuser/.nuget/packages/coverlet.msbuild/2.3.1/build/netstandard2.0/coverlet.msbuild.targets(17,5):错误:找不到方法:'Void System.IO.FileStream.. ctor(System.String,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)'。
项目配置文件(.csproj)如下:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="2.3.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
<PackageReference Include="NSubstitute" Version="4.2.2" />
</ItemGroup>
</Project>
注意: 管道运行良好,但从前一刻到下一刻,它开始产生以下错误