zoukankan      html  css  js  c++  java
  • .net 让编译成AnyCPU的程序在64位操作系统下以32位运行的方法

    如果是iis,可以动态调整一个应用程序池选项就可以。但如果是winform就比较麻烦了,那就是使用CorFlags.exe,动态更改程序集的运行头,更改启动程序集就可以了。可能得借助bat,可实现让用户使用时无感。

    使用方法如下(摘录微软官方的文档):

    The CorFlags Conversion tool allows you to configure the CorFlags section of the header of a portable executable image.

    This tool is new in the .NET Framework version 2.0.

    CorFlags.exe assembly [options]

    Parameters

     
    ArgumentDescription

    assembly

    The name of the assembly for which to configure the CorFlags.

     
    OptionDescription

    /32BIT+

    Sets the 32BIT flag.

    /32BIT-

    Clears the 32BIT flag.

    /?

    Displays command syntax and options for the tool.

    /Force

    Forces an update even if the assembly is strong-named.

     Important

    If you update a strong-named assembly, you must sign it again before executing its code.

    /help

    Displays command syntax and options for the tool.

    /ILONLY+

    Sets the ILONLY flag.

    /ILONLY-

    Clears the ILONLY flag.

    /nologo

    Suppresses the Microsoft startup banner display.

    /RevertCLRHeader

    Reverts the CLR header version to 2.0.

    /UpgradeCLRHeader

    Upgrades the CLR header version to 2.5.

     Note

    Assemblies must have a CLR header version of 2.5 or greater to run natively.

    Remarks

    If no options are specified, the CorFlags Conversion tool displays the flags for the specified assembly.

  • 相关阅读:
    生成函数学习笔记
    CF1437F Emotional Fishermen
    BZOJ 1443 [JSOI2009]游戏Game
    BZOJ 1018 [SHOI2008]堵塞的交通traffic
    访问量破1000之记录
    BZOJ 1022 [SHOI2008]小约翰的游戏John
    BZOJ1457 棋盘游戏
    BZOJ1874: [BeiJing2009 WinterCamp]取石子游戏
    BZOJ 1188 [HNOI2007]分裂游戏
    Codeforces Round #345 (Div. 2)
  • 原文地址:https://www.cnblogs.com/nanfei/p/12938395.html
Copyright © 2011-2022 走看看