积极答复者
wcf的服务端和客户端运行在.netframwork3.5环境下,想要使用压缩提高传输效率,是否必须升级到.netframework4.0?

问题
-
下载msdn的示例:WF_WCF_Samples\WCF\Extensibility\MessageEncoder\Compression 看到配置文件如下:
<?xml version="1.0"?>
<configuration>
<system.serviceModel>
<extensions>
<bindingElementExtensions>
<add name="gzipMessageEncoding" type="Microsoft.Samples.GZipEncoder.GZipMessageEncodingElement, GZipEncoder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
</bindingElementExtensions>
</extensions>
<client>
<endpoint address="http://localhost:8000/samples/GZipEncoder" bindingConfiguration="ISampleServer" binding="customBinding" contract="ISampleServer">
</endpoint>
<metadata>
<policyImporters>
<extension type="Microsoft.Samples.GZipEncoder.GZipMessageEncodingBindingElementImporter, GZipEncoder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
</policyImporters>
</metadata>
</client>
<bindings>
<customBinding>
<binding name="ISampleServer">
<gzipMessageEncoding innerMessageEncoding="textMessageEncoding"/>
<httpTransport manualAddressing="false" authenticationScheme="Anonymous" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" proxyAuthenticationScheme="Anonymous" realm="" useDefaultWebProxy="true"/>
</binding>
</customBinding>
</bindings>
</system.serviceModel>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
这种方式必须使用".NETFramework,Version=v4.0么?高人指点1。
答案
-
这取决于 gzipMessageEncoding 这个extension依赖于哪个版本的.Net Framework. 这个gzipMessageEncoding 是Microsoft Sample,所以理论上你应该有它的代码,然后你也可以修改在.Net 3.5下。但是如果他使用了4.0的API 则我们的WCF需要依赖他也就意味着需要支持.Net 4.0 了
Bob Bao
Do you still use the same Windows 8 LockScreen always? Download Chameleon Win8 App quickly, that changes your LockScreen constantly.
你是否还在看着一成不变的Windows 8锁屏而烦恼,赶紧下载这个 百变锁屏 应用,让你的锁屏不断地变化起来。
全部回复
-
这取决于 gzipMessageEncoding 这个extension依赖于哪个版本的.Net Framework. 这个gzipMessageEncoding 是Microsoft Sample,所以理论上你应该有它的代码,然后你也可以修改在.Net 3.5下。但是如果他使用了4.0的API 则我们的WCF需要依赖他也就意味着需要支持.Net 4.0 了
Bob Bao
Do you still use the same Windows 8 LockScreen always? Download Chameleon Win8 App quickly, that changes your LockScreen constantly.
你是否还在看着一成不变的Windows 8锁屏而烦恼,赶紧下载这个 百变锁屏 应用,让你的锁屏不断地变化起来。