Azure引用了错误的DLL

编程入门 行业动态 更新时间:2024-10-26 16:24:29
本文介绍了Azure引用了错误的DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

这是以下方面的后续措施:参考替代在Visual Studio 2010中引用程序集?

This is somewhat of a follow up to: Reference alternate to reference assembly in Visual Studio 2010?

我指的是核心框架DLL的替代版本.Visual Studio(和本地调试器结构)在引用此文件时没有问题.此外,该文件被标记为 Copy Local .但是,当我部署到云中时,会得到:

I am referencing an alternative version of a core framework DLL. Visual Studio (and the local debugger fabric) has no problem referencing this file. Additionally, the file is marked Copy Local. However, when I deploy to the cloud, I get:

无法加载文件或程序集'(程序集强名称)'或其依赖项之一.找到的程序集的清单定义与程序集引用不匹配.

Could not load file or assembly '(assembly strong name)' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.

使用远程桌面,我确定正确的文件确实在 E:\ approot 文件夹中,以及其他依赖项.我假设结构正在GAC中查找,而不是使用我的文件.

Using remote desktop, I determined that the correct file is indeed in the E:\approot folder along with my other dependencies. I am assuming that the fabric is looking in the GAC instead of using my files.

有没有一种方法可以强制它首先使用我的DLL?

Is there a way to force it to use my DLL first?

注意:无论如何,替换.NET CLR DLL的整个概念都是一个巨大的漏洞,因此欢迎黑客入侵.当.NET 4.5支持我需要的功能时,所有这些都将被剥离.

Note: The entire concept of replacing a .NET CLR DLL is a huge hack anyway, so hacks are welcome. When .NET 4.5 comes out supporting the feature I need, this will all be stripped out.

更多信息:看来我的Web角色工作正常,但是我的辅助角色在尝试构建Autofac容器时死于该错误.即使我在构建程序集之前显式加载了程序集,也会发生这种情况.

Further info: It appears my web role works fine, but my worker role dies with that error when it attempts to build my Autofac container. This happens even if I explicitly load the assembly before building it, which also works fine.

推荐答案

您可以运行融合日志以查看其从何处加载.如果正在运行其他文件并首先加载该文件,则可能需要为该过程创建一个.config文件.您也许可以执行一些特殊的操作,例如创建一个新的appdomain并在其中加载程序集,例如对动态程序集所做的操作:

You could run a fusion log to see where it is loading from. You may need to create a .config file for the process if something else is running and loading that file first. You may be able to do something exotic also like create a new appdomain and load your assembly there, something like what this does for dynamic assemblies:

blogs.msdn/b/tom/archive/2007/12/05/dynamic-assemblies-and-what-to-do-about-them.aspx

更多推荐

Azure引用了错误的DLL

本文发布于:2023-11-07 14:47:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1566737.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误   Azure   DLL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!