Azure Functions V2 +(.net Core 2.1)的服务模型组装错误 [英] Service Model Assembly Error With Azure Functions V2+ (.net Core 2.1)

查看:87
本文介绍了Azure Functions V2 +(.net Core 2.1)的服务模型组装错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在我的azure函数应用程序中使用azure函数V2(.net核心2.1).我一直在将 System.ServiceModel.Primitives nuget用于我的函数App,该函数在其中使用了 ServiceBusEnvironment 包.

I have been using azure function V2(.net core 2.1) in my azure function app. I have been using System.ServiceModel.Primitives nuget for my function App which uses ServiceBusEnvironment packages in it.

我能够编译代码并运行功能.调用该函数时,出现此运行时错误.

I am able to compile the code and run the function. While calling the function I get this runtime error.

   Could not load type 'System.ServiceModel.Channels.IBindingRuntimePreferences' 
from assembly 'System.ServiceModel, Version=4.0.0.0'

我用Google搜索了很多东西.但没有运气.

I googled up many things. But no luck.

然后我尝试通过将我的azure函数从V2降低到V1(.net Framework 4.7),它又开始工作了.

I then tried by lowering my azure function from V2 to V1(.net Framework 4.7) and it started working again.

在V2的情况下,我需要知道我在做什么错.在V2的情况下,如何无法得到该错误?是否有相同的分辨率?

I need to know what I am doing wrong in case of V2. And how can I not get the error in case of V2? Is there any Resolution for the same?

推荐答案

经过大量搜索,我发现一个解决方案是azure函数v2基于.net核心,并且服务总线库不能与v2(.)很好地配合使用.网络核心)

I just came to a solution after lot of search that the azure function v2 is based on .net core and service bus libraries are not working well with v2(.net core)

我发现的唯一解决方案是切换到V1,因为Azure函数V1支持.net FrameWork类.

这篇关于Azure Functions V2 +(.net Core 2.1)的服务模型组装错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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