【发布时间】:2015-05-05 10:42:16
【问题描述】:
是否可以在可移植类库中应用 bindingRedirect 或者是否有替代方法?
我们有一个 PCL 引用另一个使用 System.Net.Http.Formatting (5.2.3.0) 和 System.Net.Http.Primitives (4.2.22.0) 的 PCL。当前使用此 PCL 的代码使用以下绑定重定向:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.2.22.0" newVersion="4.2.22.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
我正在尝试在 PCL 中将此代码用于 Windows 8 Phone/Desktop 应用程序,但无法将 app.config 添加到项目中。 System.Net.Http.Formatting 参考了 System.Net.Http.Primitives 的 1.5.0.0 版本
【问题讨论】:
标签: c# windows-8 portable-class-library