打包的System.Runtime版本错误 [英] Wrong version of System.Runtime being packaged

查看:217
本文介绍了打包的System.Runtime版本错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经编写了要部署到Azure的服务.它由一个具有工作者角色"类的DLL和一个Azure云服务项目组成,如下所示:

We have written a service to be deployed to Azure. This consists of a DLL with a "Worker Role" class, and an Azure Cloud Service project, as shown below:

构建步骤为:

  1. 以发布"配置构建ccproj.
  2. 运行NuGet"spec",然后打包"以获取.nupkg文件
  3. 将.nupkg文件部署到Azure云服务

这已经工作了好一阵子,直到我们升级到.NET 4.6.2,并且还升级了其他一些引用,包括System.Runtime(现在为v4.3.1).现在,尽管事实是,我们(可能不必要)在解决方案中添加了对每个单个项目的NuGet引用,指向System.Runtime 4.3.1,即获取的System.Runtime.dll版本.部署的是较旧的版本,导致服务上出现DLL地狱,然后无法运行.如果我们手动复制System.Runtime.dll的正确版本,则一切都会恢复.

This has been working fine for a while, until we upgraded to .NET 4.6.2 and also upgraded several other references, including System.Runtime (now v4.3.1). Now, despite the fact that we have (probably unnecessarily) added a NuGet reference to every single project in the solution, pointing to System.Runtime 4.3.1, the version of System.Runtime.dll that gets deployed is an older version, resulting in DLL hell on the service, which then fails to run. If we manually copy over the correct version of System.Runtime.dll, then everything works again.

这个不正确的System.Runtime版本是从哪里来的?以及我们如何说服有问题的软件/硬件使用正确的版本?

Where is this incorrect version of System.Runtime coming from? And how do we convince the offending software/hardware to use the correct version?

更新:足迹越来越热.在我的开发计算机上,EventWorker项目的bin文件夹包含正确版本的System.Runtime.dll.但是... EventProcessor\obj\debug\EventWorker文件夹包含旧版本!我删除了obj文件夹并重新编译了该项目-DLL的旧版本再次出现.

UPDATE: Trail is getting warmer. On my development machine, the bin folder of the EventWorker project contains the correct version of System.Runtime.dll. But... the EventProcessor\obj\debug\EventWorker folder contains the old version! I deleted the obj folder and recompiled the project - and the old version of the DLL appears again.

它来自哪里,以及如何解决?

Where is it coming from, and how to fix?

推荐答案

好,我修复了它,但是我不确定为什么会这样.我从EventWorker项目中删除了 NuGet对System.Runtime的引用.现在EventProcessorRole使用的是DLL的正确版本.

Well, I fixed it, but I'm not sure why this worked. I removed the NuGet reference to System.Runtime from the EventWorker project. And now the EventProcessorRole is using the correct version of the DLL.

同时,我会将其标记为答案,但是如果有人可以提供对此行为的解释,我会给您答案...

I'll mark this as the answer in the meantime, but if anyone can provide an explanation for this behavior, I'll give you answer credit...

这篇关于打包的System.Runtime版本错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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