Using WinHTTP as a Side-by-side Assembly

Using WinHTTP as a Side-by-side Assembly

On Windows Server 2003, WinHTTP is implemented as a side-by-side assembly, and must be linked to as such. Note that this does not apply to Windows Vista and later.

Side-by-side Assemblies

Starting with Microsoft Windows XP, a side-by-side assemblies mechanism was provided to control run-time linking to avoid dynamic-link-library (DLL) versioning conflicts. For information about side-by-side assemblies, see About Isolated Applications and Side-by-side Assemblies.

从XP开始,微软就开始实施肩并肩装配机制,这样可以控制因DLL版本冲突引起的动态连接。详情参见About Isolated Applications and Side-by-side Assemblies.

To use this mechanism to link to WinHTTP version 5.1 on Windows Server 2003, an application must incorporate a manifest that specifies WinHTTP as a dependent assembly. See Using Side-by-side Assemblies for more information about how to do this.

要在WinHTTP5.1版的Windows Server 2003服务器上实现这种机制,程序包含一个manifest文件,并在其中指定WinHTTP作为第三方组件。具体怎么做参见Using Side-by-side Assemblies


WinHTTP 程序的Manifest例子

The sample manifest below illustrates an application manifest that can be used for linking to WinHTTP.

下面的manifest文件展示了manifet如何链接到WinHTTP中

All attributes except "type" of the "<assembly><assemblyIdentity>" must be modified as appropriate for your particular application. The same goes for the contents of the "<description>" element.

必须更改除了"type" of the "<assembly><assemblyIdentity>"的所有类型为你的程序。一直到"<description>"元素。

In addition, make sure that the "processorArchitecture" attribute of the "<dependentAssembly><assemblyIdentity>" matches the "processorArchitecture" attribute of the "<assembly><assemblyIdentity>". Below, for example, both are set to "x86".

另外要确保"<dependentAssembly><assemblyIdentity>""中"processorArchitecture的和"<assembly><assemblyIdentity>"属性中的"processorArchitecture匹配,下面例子中,这两项都设成了“x86”

All values not specific to your application should take the forms shown below.

你的应用中的所有特定值都应按下表设置。

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <assemblyIdentity
                    version="1.0.0.0"
                    processorArchitecture="x86"
                    name="Microsoft.Windows.Sample"
                    type="win32" />
  <description>Sample WinHttp Application</description>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity 
                    type="win32" 
                    name="Microsoft.Windows.WinHTTP" 
                    version="5.1.0.0"
                    processorArchitecture="x86" 
                    publicKeyToken="6595b64144ccf1df"
                    language="*" />
    </dependentAssembly>
  </dependency>
</assembly>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值