1

I am currently working on major refactoring of project and in the process trying to remove all Warnings our code base had. Finally down to 11 Warnings, but can't really see what is going on with 9 of them, which all seem to be related. Something like:

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 Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets 2106

enter image description here

  • I have Consolidated the nuget package versions.
  • Checked the Csproj file and it seemed fine. (See below.)

All warnings are in 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>
Kiksen
  • 1,559
  • 1
  • 18
  • 41
  • 1
    Looks like some has asked the same question: https://stackoverflow.com/questions/54139375/warningnetsdk1071a-packagereference-to-microsoft-aspnetcore-app-specified-a – Lok C Oct 08 '19 at 14:35

1 Answers1

3

Try to use the web SDK (Microsoft.NET.Sdk.Web instead of Microsoft.NET.Sdk) and add a package reference to Microsoft.AspNetCore.App without specifying a version

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp2.2</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.App" />  
  </ItemGroup>

</Project>

Refer to Integration and unit tests no longer work on ASP.NET Core 2.1 failing to find assemblies at runtime

https://github.com/dotnet/sdk/issues/2253

Ryan
  • 19,118
  • 10
  • 37
  • 53