zoukankan      html  css  js  c++  java
  • 再论Assembly Registration Tool (Regasm.exe)

    Assembly Registration Tool (Regasm.exe)

    The Assembly Registration tool reads the metadata within an assembly and adds the necessary entries to the registry, which allows COM clients to create .NET Framework classes transparently. Once a class is registered, any COM client can use it as though the class were a COM class. The class is registered only once, when the assembly is installed. Instances of classes within the assembly cannot be created from COM until they are actually registered.

    regasm assemblyFile [options]

    Parameter

    Description

    assemblyFile

    The assembly to be registered with COM.

    Using the /tlb option has the same effect as using the Type Library Exporter (Tlbexp.exe) and Regasm.exe, with the exception that Tlbexp.exe does not register the type library it produces. If you use the /tlb option to registered a type library, you can use /tlb option with the /unregister option to unregistered the type library. Using the two options together will unregister the type library and interface entries, which can clean the registry considerably.

    When you register an assembly for use by COM, Regasm.exe adds entries to the registry on the local computer. More specifically, it creates version-dependent registry keys that allow multiple versions of the same assembly to run side by side on a computer. The first time an assembly is registered, one top-level key is created for the assembly and a unique subkey is created for the specific version. Each time you register a new version of the assembly, Regasm.exe creates a subkey for the new version.

    After registering an assembly using Regasm.exe, you can install it in the global assembly cache so that it can be activated from any COM client. If the assembly is only going to be activated by a single application, you can place it in that application's directory.

    The following command registers all public classes contained in myTest.dll.

     
    regasm myTest.dll
    

    The following command generates the file myTest.reg, which contains all the necessary registry entries. This command does not update the registry.

    regasm myTest.dll /regfile:myTest.reg
    

    The following command registers all public classes contained in myTest.dll, and generates and registers the type library myTest.tlb, which contains definitions of all the public types defined in myTest.dll.

    regasm myTest.dll /tlb:myTest.tlb
    
  • 相关阅读:
    Python中使用pip安装库时提示:远程主机强迫关闭了一个现有的连接
    一个真正有能力的人
    一个程序员的自白(延迟满足)
    小规模团队如何“微服务”管理
    一个程序员的自白(无知之者)
    小型系统如何“微服务”开发
    TCP协议学习总结(下)
    TCP协议学习总结(中)
    TCP协议学习总结(上)
    一个程序员的自白(三十而立)
  • 原文地址:https://www.cnblogs.com/MayGarden/p/1714823.html
Copyright © 2011-2022 走看看