无法加载文件或程序集'Microsoft.WindowsAzure.Storage'或其某个依赖项。运行C#聊天机器人时发生。

7
我正在尝试在Visual Studio中进行一些修改后运行我的聊天机器人。当我在bot framework仿真器上本地运行代码时,代码可以正常工作,但是当我将代码发布到存储在Azure上的聊天机器人时,我会遇到以下错误:
“无法加载文件或程序集'Microsoft.WindowsAzure.Storage'或其依赖项之一。定位的程序集清单定义与程序集引用不匹配。(HRESULT异常:0x80131040)”
如有任何帮助或对此问题的见解,将不胜感激!

你的 Microsoft.WindowsAzure.Storage 版本是多少?你使用 Microsoft.Azure.WebJobs 吗? - mskuratowski
Microsoft.WindowsAzure.Storage的版本是9.3.1,但我在我的项目中没有安装Microsoft.Azure.WebJobs,我需要安装吗? - user10190803
2个回答

2

打开NuGet控制台,粘贴以下内容以安装缺失的软件包:

Install-Package WindowsAzure.Storage -Version 9.3.1

所以这并没有解决问题,我还尝试了粘贴以下内容到Web.Config文件中:<dependentAssembly> <assemblyIdentity name="Microsoft.WindowsAzure.Storage" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-9.3.1.0" newVersion="9.3.1.0" /> </dependentAssembly>,但仍然收到相同的错误信息。 - user10190803
1
实际上,这行代码:"The located assembly's manifest definition does not match the assembly reference." 的意思是 DLL 版本与引用的 DLL 版本不同。 - Matěj Štágl
那么我该如何找出当前在 Azure 代码中运行的 DLL 版本?如果它是旧版本,该如何更新? - user10190803

0

从 Web 配置文件中删除此内容。

<dependentAssembly> <assemblyIdentity name="Microsoft.WindowsAzure.Storage" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-9.3.1.0" newVersion="9.3.1.0" /> </dependentAssembly>

从 Web 配置文件中删除这些行,然后重新构建您的应用程序。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接