具有相同依赖项的不同版本的nuget软件包的Azure函数 [英] azure functions with nuget packages that have different versions of the same dependency

查看:86
本文介绍了具有相同依赖项的不同版本的nuget软件包的Azure函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个Azure函数,该函数使用来自我的私人提要的2个nuget包(A和B).程序包A直接使用Dapper版本1.50.2,而程序包B使用Dapper.SimpleCrud 1.13.0,它依赖于Dapper版本[1.42.0,2.0.0).

I am writing an Azure Function that is using 2 nuget packages (A and B) from my private feed. Package A uses Dapper version 1.50.2 directly and package B uses Dapper.SimpleCrud 1.13.0 which has a dependency on Dapper version [1.42.0, 2.0.0).

在Azure函数中,我添加了project.json,其中指定了程序包A和B及其版本.

Within the Azure Function I have added project.json where I specify package A and B and their versions.

当我在azure函数中查看已安装的软件包时,我看到都安装了Dapper 1.42.0和1.50.2.当我尝试调用程序包A和B中的方法时,我在azure函数日志中收到一条错误消息,提示它找不到Dapper版本1.40. (取决于我设置project.json的方式,它是Dapper 1.40或Azure Function找不到的1.50)

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

我已经创建了Dapper.SimpleCRUD软件包的测试版本,其中对dapper的依赖来自[1.50.2,2.0.0),并且一切正常.

I have created a test version of the Dapper.SimpleCRUD package where the dependency on dapper is from [1.50.2, 2.0.0) and every thing works.

我也曾尝试将Dapper 1.50.2添加到project.json中,希望它可以被Dapper.SimpleCRUD使用,但它似乎仍然可以加入Dapper 1.42.

I have also tried to add Dapper 1.50.2 to project.json in the hopes that it will be used by Dapper.SimpleCRUD, but it still seems to pull in Dapper 1.42.

Azure Functions上是否缺少一些设置以允许此设置正常工作,或者这是对Azure Function包管理的限制吗?

Is there some setting that I missing on Azure Functions to allow this setup to work or is this a limitation on Azure Function package management ?.

感谢您可以提供的任何帮助.

Thanks for any help you can provide.

推荐答案

我似乎遇到了一个问题(即使在2016年10月之前也是AFAIK),他们仍然没有找到在Azure函数中进行绑定重定向的好方法.

I seems like an issue (AFAIK even as late as Oct 2016) that they still haven't figured out a good way of doing binding redirects in azure function.

我的azure函数使用两个具有相同依赖项(但版本不同)的不同nuget包时遇到了类似的问题.

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

这里有一个类似的问题: Azure Functions绑定重定向

There was a similar question asked here : Azure Functions binding redirect

我最终保留了尽可能少的nuget,以避免绑定重定向.如果您的项目无法做到这一点,请尝试将其用于webjobs(至少作为一种短期解决方案),直到azure函数支持此功能为止.

I ended up keeping the least possible number of nugets to avoid binding redirects. If this is not possible with your project try using for webjobs (atleast as a short term solution) till azure functions supports this.

这篇关于具有相同依赖项的不同版本的nuget软件包的Azure函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆