microsoft / durabletask-mssql

Microsoft SQL storage provider for Durable Functions and the Durable Task Framework
MIT License
87 stars 32 forks source link

NU1605: Warning As Error: Detected package downgrade: Microsoft.Azure.WebJobs.Extensions.DurableTask from 2.13.2 to 2.13.1 #212

Closed gsimardimt closed 5 months ago

gsimardimt commented 5 months ago

Our project suddenly stopped building since the release of Microsoft.Azure.Functions.Worker.Extensions.DurableTask.SqlServer 1.2.3 even thought we have NOT changed anything since the last successful build.

We get the following error:

WorkerExtensions.csproj : error NU1605: Warning As Error: Detected package downgrade: Microsoft.Azure.WebJobs.Extensions.DurableTask from 2.13.2 to 2.13.1. Reference the package directly from the project to select a different version. 
WorkerExtensions.csproj : error NU1605:  Microsoft.Azure.Functions.Worker.Extensions -> Microsoft.DurableTask.SqlServer.AzureFunctions 1.2.3 -> Microsoft.Azure.WebJobs.Extensions.DurableTask (>= 2.13.2) 
WorkerExtensions.csproj : error NU1605:  Microsoft.Azure.Functions.Worker.Extensions -> Microsoft.Azure.WebJobs.Extensions.DurableTask (>= 2.13.1)

We were able to reproduce the problem with the following csproj:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <AzureFunctionsVersion>v4</AzureFunctionsVersion>
    <OutputType>Exe</OutputType>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.21.0" />
    <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.1.0" />
    <PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.17.2" />

    <!--This reference was working last week-->
    <!--<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.DurableTask" Version="1.1.1" />-->

    <!--Now we are forced to update to this new version-->
    <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.DurableTask" Version="1.1.2" />

    <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.DurableTask.SqlServer" Version="1.2.2" />
  </ItemGroup>
  <ItemGroup>
    <None Update="host.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
    <None Update="local.settings.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      <CopyToPublishDirectory>Never</CopyToPublishDirectory>
    </None>
  </ItemGroup>
  <ItemGroup>
    <Using Include="System.Threading.ExecutionContext" Alias="ExecutionContext" />
  </ItemGroup>
</Project>

Our understanding is that "Microsoft.Azure.Functions.Worker.Extensions.DurableTask.SqlServer" brings a floating version ("Microsoft.DurableTask.SqlServer.AzureFunctions" Version="1.2.*") in the WorkerExtensions project. This causes a problem because the ...DurableTask" v1.1.1 reference brings an explicit reference to "Microsoft.Azure.WebJobs.Extensions.DurableTask" Version="2.13.1" in the same WorkerExtensions project

A project that was building fine should not suddenly stop building because a new version of a library is released. We feel that we have no control on the time we are ready to upgrade. Also, it was very difficult to understand the solution since we have no dependency (direct or indirect) on the libraries mentioned.

Your reference to 1.2.* should be replaced to an explicit version.

cgillum commented 5 months ago

Hi @gsimardimt, yikes, I agree that this is problematic. I was not aware of this kind of side-effect of using the floating version. I'll remove it in subsequent releases.