我正在尝试使用以下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>
Run Code Online (Sandbox Code Playgroud)
我在GAC中使用版本9.0.242.0的计算机上运行该程序,并使用指定的公钥令牌.CLR似乎甚至没有尝试重定向绑定以使用该版本.
这是我在fuslogvw.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 …