使用 Visual Studio 2013 部署时不会复制相关依赖项 (DLL) [英] Relevant dependencies (DLL) not being copied when deploying using Visual Studio 2013

查看:20
本文介绍了使用 Visual Studio 2013 部署时不会复制相关依赖项 (DLL)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我正在部署的一个 webjobs 中,我引用了我的一个类库 (Core),它负责运行某个进程(在本例中使用 SendGrid 发送电子邮件).

In one of the webjobs I'm deploying, I'm referencing one of my class libraries (Core) that is taking care of running some process (in this case sending an email using SendGrid).

当我手动部署我的 webjobs(上传 .zip 文件)时,一切正常.我清理了部署并使用 Visual Studio 2013 重新部署,webjob 开始出现问题.这里的主要问题是它正在寻找被我的核心类库而不是我的控制台应用程序引用的 SendGrid dll 并且它没有发现它抛出以下错误:

When I deployed my webjobs manually (uploading .zip file) everything worked fine. I cleaned up the deployment and re-deployed using Visual Studio 2013 and the webjob started to have problems. The main issue here is that it's looking for the SendGrid dll that's referenced by my Core class library and not my Console app and it's not finiding it throwing the following error:

未处理的异常:System.IO.FileLoadException:无法加载文件或程序集SendGrid....Version=4.5.0.0,Culture=neutral,PublicKeyToken=30ad4fe6b2a6aeed"或其依赖项之一.找到的程序集的清单定义与程序集引用不匹配.(来自 HRESULT 的异常:0x80131040)"

"Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'SendGrid.... Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"

我通过 FTP 进入网站,发现实际上 SendGrid 程序集不在我的 WebJob 所在的位置.

I FTP'd into the website and found that effectively the SendGrid assembly is not where my WebJob is at.

我的问题是:在使用 VS 2013 进行部署时,有没有办法强制将此依赖项复制到正确的目录?

My question is: is there a way to force that this dependencies get copied to the right directory when deploying using VS 2013?

谢谢,

推荐答案

我是在 2013 年夏季更新中推出 WebJobs 工具的团队成员,我可以让您知道我们已经意识到这个问题并为即将发布的下一次更新签入了修复程序.与此同时,解决方法是将程序集引用设置为您需要的程序集 - NuGet 包本身就可以解决这个问题 - 然后重新发布.实际上,我们使用 NuGet 包 来为 WebJobs 执行我们的部署逻辑对比.发布更新后,我们还将发布 NuGet(现在正在进行最终测试),因此夏季秋季更新的客户将缓解此问题.

I'm a member of the team who put the WebJobs tooling out in the Summer 2013 Update, and I can let you know we're aware of this issue and have checked in a fix for it for the next update, which is coming out soon. In the meantime, the workaround is to set assembly references to the assemblies you need - the NuGet packages alone will do solve this issue - and re-publish. We actually use a NuGet package to do our deployment logic for WebJobs within VS. Once we release the update, we'll also release the NuGet (which is going through final testing now), so customers on the Summer and Fall updates will have this issue mitigated.

这篇关于使用 Visual Studio 2013 部署时不会复制相关依赖项 (DLL)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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