Hiram Katz
Hiram Katz

Reputation: 383

Unable to find a version of 'Microsoft.Azure.WebJobs' that is compatible with

Need help trying to escape Nuget Hell.

I'm trying to install Microsoft.Net.Sdk.Functions, version 1.0.7, which has a dependency on

Microsoft.Azure.WebJobs (= 2.0.1-beta4)

In my packages.config of my project I reference

<package id="Microsoft.Azure.WebJobs" version="2.1.0" targetFramework="net461" />

and in the packages of my solution I have

Microsoft.Azure.WebJobs.2.1.0

I get the error

Unable to find a version of 'Microsoft.Azure.WebJobs' that is compatible with 'Microsoft.NET.Sdk.Functions 1.0.7 constraint: Microsoft.Azure.WebJobs (= 2.1.0-beta4)'.

when trying to install Microsoft.Net.Sdk.Functions.

What gives? Something to do with needing -beta4? Because when I look in Nuget at Microsoft.Azure.WebJobs, there is no version suffixed -beta4.

Upvotes: 3

Views: 1626

Answers (1)

Matt Ward
Matt Ward

Reputation: 47907

Microsoft.Net.Sdk.Functions 1.0.7 is tied to a single version of the Microsoft.Azure.WebJobs version 2.1.0-beta4. If you have any other version of Microsoft.Azure.WebJobs installed then you cannot install Microsoft.Net.Sdk.Functions 1.0.7.

  <group targetFramework=".NETFramework4.6">
    <dependency id="Microsoft.Azure.WebJobs" version="[2.1.0-beta4]" exclude="Build,Analyzers" />
    <dependency id="Microsoft.Azure.WebJobs.Extensions" version="[2.1.0-beta4]" exclude="Build,Analyzers" />
    <dependency id="Microsoft.Azure.WebJobs.Extensions.Http" version="[1.0.0-beta4]" exclude="Build,Analyzers" />
    <dependency id="Newtonsoft.Json" version="[9.0.1]" exclude="Build,Analyzers" />
    <dependency id="System.ValueTuple" version="4.3.0" exclude="Build,Analyzers" />
  </group>

The square brackets around the version indicate that only that specific version is supported. Without the square brackets, such as with System.ValueTuple, indicates that the version needed is that version or higher.

So to get that version of Microsoft.Net.Sdk.Functions to install you would need to uninstall Microsoft.Azure.WebJobs 2.1.0 you have installed.

There are other options, such as installing Microsoft.Net.Sdk.Functions 1.0.8 which depends on Microsoft.Azure.WebJobs 2.1.0, which you have installed.

On nuget.org the Microsoft.Azure.WebJobs 2.1.0-beta4 NuGet package does exist - https://www.nuget.org/packages/Microsoft.Azure.WebJobs/2.1.0-beta4 - I am guessing you do not have pre-release checked when searching for this NuGet package.

Upvotes: 3

Related Questions