【发布时间】:2014-08-01 19:04:19
【问题描述】:
我在我的项目中使用了两个第三方 facebook dll,它们都有不同的用途但具有相同的名称“facebook.dll”。在添加引用时,我发现同名冲突,所以我将一个 dll 的名称更改为“facebookpost”并添加了它的引用。我知道只需更改该 dll 的名称并没有任何区别。但我需要在我的项目中使用这两个 dll。我怎样才能做到这一点?
我尝试了以下但没有运气
<?xml version="1.0"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="ClassLibrary1" publicKeyToken="fbc28d9ca2fc8db5" />
<publisherPolicy apply="no" />
<bindingRedirect oldVersion="1.0.0.0" newVersion="1.1.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
更新: 我有一些如何设法使用“外部别名”获取对 faceook.dll 的外部引用,但我收到一个错误“/reference 选项中未指定外部别名”
更新 通过遵循 The extern alias 'xxx' was not specified in a /reference option 中的 Orca 方法,我解决了“未在 /reference 选项中指定外部别名”的问题。但现在以这个新错误结束 - “无法加载文件或程序集 '[MyAliasName]' 或其依赖项之一。定位的程序集的清单定义与程序集引用不匹配。”
【问题讨论】: