Azure / azure-relay

☁️ Azure Relay service issue tracking and samples
https://azure.microsoft.com/services/service-bus
MIT License
86 stars 85 forks source link

`WindowsAzure.ServiceBus` nuget package version `6.2.0` generates warnings when PackageReferenced #70

Closed inthemedium closed 2 years ago

inthemedium commented 2 years ago

Description

When PackageReferencing WindowsAzure.ServiceBus 6.2.0 it generates a warning because there is a mismatch between the declared dependency in the package's nuspec of 1.0.3 (see "snip from nuspec below") and the dependency required by the Microsoft.ServiceBus assembly of 1.4.0.0 (see screenshot from ILSpy).

This issue is easily repro'd with the following csproj

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

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net48</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="WindowsAzure.ServiceBus" Version="6.2.0" />
  </ItemGroup>
</Project>

Snip from nuspec:

      <dependency id="Microsoft.Azure.Services.AppAuthentication" version="1.0.3" />

References from ILSpy

// Detected Target-Framework-Id: .NETFramework,Version=v4.6.2

// Referenced assemblies (in metadata order):
// Microsoft.Azure.Services.AppAuthentication, Version=1.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35

Actual Behavior

  1. There are warnings like this:
    Build started...
    1>------ Build started: Project: ConsoleApp34, Configuration: Debug Any CPU ------
    1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2304,5): warning MSB3277: Found conflicts between different versions of "Microsoft.Azure.Services.AppAuthentication" that could not be resolved.
    1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2304,5): warning MSB3277: There was a conflict between "Microsoft.Azure.Services.AppAuthentication, Version=1.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" and "Microsoft.Azure.Services.AppAuthentication, Version=1.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35".
    1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2304,5): warning MSB3277:     "Microsoft.Azure.Services.AppAuthentication, Version=1.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" was chosen because it was primary and "Microsoft.Azure.Services.AppAuthentication, Version=1.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" was not.
    1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2304,5): warning MSB3277:     References which depend on "Microsoft.Azure.Services.AppAuthentication, Version=1.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" [C:\Users\user\.nuget\packages\microsoft.azure.services.appauthentication\1.0.3\lib\net452\Microsoft.Azure.Services.AppAuthentication.dll].
    1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2304,5): warning MSB3277:         C:\Users\user\.nuget\packages\microsoft.azure.services.appauthentication\1.0.3\lib\net452\Microsoft.Azure.Services.AppAuthentication.dll
    1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2304,5): warning MSB3277:           Project file item includes which caused reference "C:\Users\user\.nuget\packages\microsoft.azure.services.appauthentication\1.0.3\lib\net452\Microsoft.Azure.Services.AppAuthentication.dll".
    1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2304,5): warning MSB3277:             C:\Users\user\.nuget\packages\microsoft.azure.services.appauthentication\1.0.3\lib\net452\Microsoft.Azure.Services.AppAuthentication.dll
    1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2304,5): warning MSB3277:     References which depend on "Microsoft.Azure.Services.AppAuthentication, Version=1.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" [].
    1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2304,5): warning MSB3277:         C:\Users\user\.nuget\packages\windowsazure.servicebus\6.2.0\lib\net462\Microsoft.ServiceBus.dll
    1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2304,5): warning MSB3277:           Project file item includes which caused reference "C:\Users\user\.nuget\packages\windowsazure.servicebus\6.2.0\lib\net462\Microsoft.ServiceBus.dll".
    1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2304,5): warning MSB3277:             C:\Users\user\.nuget\packages\windowsazure.servicebus\6.2.0\lib\net462\Microsoft.ServiceBus.dll
    1>ConsoleApp34 -> C:\Users\user\source\repos\ConsoleApp34\ConsoleApp34\bin\Debug\net48\ConsoleApp34.exe
    1>Done building project "ConsoleApp34.csproj".
    ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

Expected Behavior

  1. No warnings
inthemedium commented 2 years ago

I believe the fix for this is to update the Microsoft.Azure.Services.AppAuthentication dependency from <dependency id="Microsoft.Azure.Services.AppAuthentication" version="1.0.3" /> to <dependency id="Microsoft.Azure.Services.AppAuthentication" version="1.4.0" />

inthemedium commented 2 years ago

This is fixed in version 6.2.1. Thanks!