Dotnet core 不同版本之间的冲突"Microsoft.AspNetCore.Authentication.Abstractions"
Donet core Conflicts between different versions of "Microsoft.AspNetCore.Authentication.Abstractions"
我目前正在对项目进行重大重构,并在此过程中尝试删除我们的代码库中的所有警告。最后减少到 11 个警告,但无法真正看到其中 9 个发生了什么,它们似乎都是相关的。类似于:
Severity Code Description Project File Line Suppression State
Warning MSB3277 Found conflicts between different versions of
"Microsoft.AspNetCore.Authentication.Abstractions" that could not be
resolved. These reference conflicts are listed in the build log when
log verbosity is set to
detailed. #######.Test.Integration C:\Program Files
(x86)\Microsoft Visual
Studio19\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets 2106
- 我已经整合了 nuget 包版本。
- 检查了 Csproj 文件,似乎没问题。 (见下文。)
所有警告都在 Microsoft.AspNetCore.*
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FakeItEasy" Version="5.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\###\###API.csproj" />
<ProjectReference Include="..\###\###.Core.csproj" />
<ProjectReference Include="..\###\###.Data.csproj" />
</ItemGroup>
</Project>
尝试使用网络 SDK(Microsoft.NET.Sdk.Web
而不是 Microsoft.NET.Sdk
)并添加对 Microsoft.AspNetCore.App
的包引用而不指定版本
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
</Project>
参考
我目前正在对项目进行重大重构,并在此过程中尝试删除我们的代码库中的所有警告。最后减少到 11 个警告,但无法真正看到其中 9 个发生了什么,它们似乎都是相关的。类似于:
Severity Code Description Project File Line Suppression State Warning MSB3277 Found conflicts between different versions of "Microsoft.AspNetCore.Authentication.Abstractions" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. #######.Test.Integration C:\Program Files (x86)\Microsoft Visual Studio19\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets 2106
- 我已经整合了 nuget 包版本。
- 检查了 Csproj 文件,似乎没问题。 (见下文。)
所有警告都在 Microsoft.AspNetCore.*
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FakeItEasy" Version="5.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\###\###API.csproj" />
<ProjectReference Include="..\###\###.Core.csproj" />
<ProjectReference Include="..\###\###.Data.csproj" />
</ItemGroup>
</Project>
尝试使用网络 SDK(Microsoft.NET.Sdk.Web
而不是 Microsoft.NET.Sdk
)并添加对 Microsoft.AspNetCore.App
的包引用而不指定版本
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
</Project>
参考