Azure with nuget packages that have different versions of the same dependency

I am writing an Azure function that uses 2 nuget packages (A and B) from my personal feed. Package A uses Dapper version 1.50.2 directly, and Package B uses Dapper.SimpleCrud 1.13.0, which is dependent on Dapper version [1.42.0, 2.0.0].

As part of the Azure function, I added project.json, where I specify packages A and B and their versions.

When I look at installed packages in the azure function, I see that Dapper 1.42.0 and 1.50.2 are installed. when I try to call methods in packages A and B, I get an error in the azure function logs saying that it cannot find Dapper version 1.40. (depending on how I installed my .json project, it will be either Dapper 1.40 or 1.50, which is not found by Azure Function)

I created a test version of the Dapper.SimpleCRUD package, where the dapper dependency on [1.50.2, 2.0.0] and everything works.

I also tried adding Dapper 1.50.2 to project.json in the hope that it would be used by Dapper.SimpleCRUD, but it still seems to be pulling in Dapper 1.42.

Is there some kind of setting that I skip in Azure Functions so that this setting works or is it a limitation for managing Azure packages?

Thanks for any help you can provide.

+6
source share
1 answer

It seems to me that the problem (AFAIK back in October 2106) is that they still have not figured out a good way to perform call forwarding in the azure function.

I ran into a similar problem with my azure function using two different nuget packages with the same dependency (but with different versions).

A similar question was asked here: Azure Binding Functions Binding Redirection

In the end, I left the smallest number of nudges to avoid linking redirects. If this is not possible in your project, try using webjobs (at least as a short-term solution) until the azure functions confirm this.

+4
source

Source: https://habr.com/ru/post/1012671/


All Articles