大会绑定重定向不起作用 [英] Assembly binding redirect does not work

查看:240
本文介绍了大会绑定重定向不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图建立一个集绑定重定向,使用下面的app.config:

I'm trying to set up an assembly binding redirect, using the following app.config:

<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.AnalysisServices"
                          PublicKeyToken="89845dcd8080cc91" />
        <bindingRedirect oldVersion="10.0.0.0"
                         newVersion="9.0.0.0" />
      </dependentAssembly>
     </assemblyBinding>
  </runtime>
</configuration>

我在一台机器上运行的程序版本9.0.242.0在GAC中,使用指定的公钥标记。在CLR似乎并不甚至试图重定向结合虽然使用该版本

I'm running the program on a machine with version 9.0.242.0 in the GAC, with the specified public key token. The CLR doesn't seem to be even trying to redirect the binding to use that version though.

下面是我所得到的fuslogvw.exe:

Here is what I get in fuslogvw.exe:

日志:此绑定从default加载上下文。 日志:正在使用应用程序配置文件:\调试\ AssemblyRedirectPOC.exe.Config 日志:从C使用计算机配置文件:\ WINDOWS \ Microsoft.NET \框架\ V2.0.50727 \ CONFIG \ machine.config中。 日志:后政策参考:Microsoft.AnalysisServices,版本= 10.0.0.0,文化=中性公钥= 89845dcd8080cc91 日志:GAC查找不成功。 日志:新的URL /Debug/Microsoft.AnalysisServices.DLL尝试下载。 日志:新的URL /Debug/Microsoft.AnalysisServices/Microsoft.AnalysisServices.DLL尝试下载。 日志:新的URL /Debug/Microsoft.AnalysisServices.EXE尝试下载。 日志:新的URL /Debug/Microsoft.AnalysisServices/Microsoft.AnalysisServices.EXE尝试下载。 日志:所有探测网址企图失败了。

LOG: This bind starts in default load context. LOG: Using application configuration file: \Debug\AssemblyRedirectPOC.exe.Config LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config. LOG: Post-policy reference: Microsoft.AnalysisServices, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91 LOG: GAC Lookup was unsuccessful. LOG: Attempting download of new URL /Debug/Microsoft.AnalysisServices.DLL. LOG: Attempting download of new URL /Debug/Microsoft.AnalysisServices/Microsoft.AnalysisServices.DLL. LOG: Attempting download of new URL /Debug/Microsoft.AnalysisServices.EXE. LOG: Attempting download of new URL /Debug/Microsoft.AnalysisServices/Microsoft.AnalysisServices.EXE. LOG: All probing URLs attempted and failed.

当我试图把9.0.242.0版本的DLL在探测路径,我得到这个代替:

When I tried putting the 9.0.242.0 version dll in the probe path, I get this instead:

日志:程序集下载成功。文件试图设置:\调试\ Microsoft.AnalysisServices.dll 日志:进入运行从源代码安装阶段。 日志:大会名称为:Microsoft.AnalysisServices,版本= 9.0.242.0,文化=中性公钥= 89845dcd8080cc91 警告:比较程序集名称时发生不匹配:主要版本 错误:程序集引用未找到该组件定义相匹配。 错误:未能完成安装的组件(HR = 0x80131040)。探测终止。

LOG: Assembly download was successful. Attempting setup of file: \Debug\Microsoft.AnalysisServices.dll LOG: Entering run-from-source setup phase. LOG: Assembly Name is: Microsoft.AnalysisServices, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91 WRN: Comparing the assembly name resulted in the mismatch: Major Version ERR: The assembly reference did not match the assembly definition found. ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

请注意,我也试图改变重定向到在App.config使用,而不是9.0.0.0,9.0.242.0,并没有工作,但我不认为它应该有什么区别。

Note that I also tried changing the redirect to use "9.0.242.0" instead of "9.0.0.0" in the app.config and that didn't work, although I don't think it should make any difference.

据我了解重定向绑定的整点是使用的版本不匹配该程序附带。难道我完全失去了一些东西在这里?就是我想要做的可能,如果是这样,为什么它不工作的任何想法?

From what I understand the whole point of redirecting a binding is to use a version that does not match that which the program was built with. Am I completely missing something here? Is what I'm trying to do possible, and if so, any idea of why it's not working?

干杯, 亚当

推荐答案

任何错字的配置XML可以是一个原因。装载机看不出你的配置。 我也有一个小时的头痛,直到我认识到错误是字符,而不是=, - ,在模式名:

Any typo in configuration xml can be a cause. Loader just can't see your configuration. I also had a hour of headache until I realize that the error was in character "=" instead of "-" in schema name:

<assemblyBinding xmlns="urn:schemas=microsoft-com:asm.v1">

只要仔细的所有属性名称和值检查。我猜公钥应为公钥

Just check carefully all attribute names and values. I guess "PublicKeyToken" should be "publicKeyToken"

这应该工作:

<configuration>
<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <dependentAssembly>
            <assemblyIdentity name="Microsoft.AnalysisServices" publicKeyToken="89845dcd8080cc91" />
            <bindingRedirect oldVersion="10.0.0.0" newVersion="9.0.0.0"/>
        </dependentAssembly>
    </assemblyBinding>
</runtime>
</configuration>

这篇关于大会绑定重定向不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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