none
How to extract registration data from .net assemblies? RRS feed

  • Question

  • Hello experts :).

    I have some .net assemblies which exposes COM. And we register these using RegAsm.

    Now I've a requirement to get the registration data from those .net assemblies and generate some configuration file to be used on other computers in our network.

    How can I extract registration data for .net assemblies without using RegAsm?

    Any help would be greatly appreciated.

    Thanks



    Best regards Farrukh

    Friday, May 4, 2012 12:07 PM

Answers

  • Hello Farrukh,

    1. You can use REGASM.EXE with the /regfile flag.

    2. For example, let's say you have a COM-visible C# class library named CSCOMServer.dll.

    3. You can run REGASM.EXE as follows :

    regasm CSCOMServer.dll /regfile:CSCOMServer.reg

    4. The output .reg file is a registry file. It is a text file that lists the registry keys and values that REGASM.EXE would have written to the registry.

    5. The information in the .reg file is written in a format recognizable by REGEDIT.EXE. It can even be used directly by REGEDIT.EXE to perform registration.

    6. Here is a sample .REG file listing :

    REGEDIT4
    [HKEY_CLASSES_ROOT\CSCOMServer.CSCOMClass01]
    @="CSCOMServer.CSCOMClass01"
    [HKEY_CLASSES_ROOT\CSCOMServer.CSCOMClass01\CLSID]
    @="{36E6BC94-308C-4952-84E6-109041990EF7}"
    [HKEY_CLASSES_ROOT\CLSID\{36E6BC94-308C-4952-84E6-109041990EF7}]
    @="CSCOMServer.CSCOMClass01"
    [HKEY_CLASSES_ROOT\CLSID\{36E6BC94-308C-4952-84E6-109041990EF7}\InprocServer32]
    @="mscoree.dll"
    "ThreadingModel"="Both"
    "Class"="CSCOMServer.CSCOMClass01"
    "Assembly"="CSCOMServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
    "RuntimeVersion"="v2.0.50727"
    [HKEY_CLASSES_ROOT\CLSID\{36E6BC94-308C-4952-84E6-109041990EF7}\InprocServer32\1.0.0.0]
    "Class"="CSCOMServer.CSCOMClass01"
    "Assembly"="CSCOMServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
    "RuntimeVersion"="v2.0.50727"
    [HKEY_CLASSES_ROOT\CLSID\{36E6BC94-308C-4952-84E6-109041990EF7}\ProgId]
    @="CSCOMServer.CSCOMClass01"
    [HKEY_CLASSES_ROOT\CLSID\{36E6BC94-308C-4952-84E6-109041990EF7}\Implemented Categories\{62C8FE65-4EBB-45E7-B440-6E39B2CDBF29}]

    - Bio.


    Please visit my blog : http://limbioliong.wordpress.com/

    Friday, May 4, 2012 3:31 PM
  • Hi, 

    And, 

    You can also perform Registration-Free Activation, how? from here  http://msdn.microsoft.com/library/ms973915.aspx.



    If this post answers your question, please click "Mark As Answer". If this post is helpful please click "Mark as Helpful".


    Saturday, May 5, 2012 5:25 AM
  • Hi Fahrruk,

    please check this:

    http://msdn.microsoft.com/hi-in/magazine/cc164006(en-us).aspx


    Regards, http://shwetamannjain.blogspot.com

    Friday, May 4, 2012 1:40 PM

All replies

  • Hi Fahrruk,

    please check this:

    http://msdn.microsoft.com/hi-in/magazine/cc164006(en-us).aspx


    Regards, http://shwetamannjain.blogspot.com

    Friday, May 4, 2012 1:40 PM
  • Hello Farrukh,

    1. You can use REGASM.EXE with the /regfile flag.

    2. For example, let's say you have a COM-visible C# class library named CSCOMServer.dll.

    3. You can run REGASM.EXE as follows :

    regasm CSCOMServer.dll /regfile:CSCOMServer.reg

    4. The output .reg file is a registry file. It is a text file that lists the registry keys and values that REGASM.EXE would have written to the registry.

    5. The information in the .reg file is written in a format recognizable by REGEDIT.EXE. It can even be used directly by REGEDIT.EXE to perform registration.

    6. Here is a sample .REG file listing :

    REGEDIT4
    [HKEY_CLASSES_ROOT\CSCOMServer.CSCOMClass01]
    @="CSCOMServer.CSCOMClass01"
    [HKEY_CLASSES_ROOT\CSCOMServer.CSCOMClass01\CLSID]
    @="{36E6BC94-308C-4952-84E6-109041990EF7}"
    [HKEY_CLASSES_ROOT\CLSID\{36E6BC94-308C-4952-84E6-109041990EF7}]
    @="CSCOMServer.CSCOMClass01"
    [HKEY_CLASSES_ROOT\CLSID\{36E6BC94-308C-4952-84E6-109041990EF7}\InprocServer32]
    @="mscoree.dll"
    "ThreadingModel"="Both"
    "Class"="CSCOMServer.CSCOMClass01"
    "Assembly"="CSCOMServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
    "RuntimeVersion"="v2.0.50727"
    [HKEY_CLASSES_ROOT\CLSID\{36E6BC94-308C-4952-84E6-109041990EF7}\InprocServer32\1.0.0.0]
    "Class"="CSCOMServer.CSCOMClass01"
    "Assembly"="CSCOMServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
    "RuntimeVersion"="v2.0.50727"
    [HKEY_CLASSES_ROOT\CLSID\{36E6BC94-308C-4952-84E6-109041990EF7}\ProgId]
    @="CSCOMServer.CSCOMClass01"
    [HKEY_CLASSES_ROOT\CLSID\{36E6BC94-308C-4952-84E6-109041990EF7}\Implemented Categories\{62C8FE65-4EBB-45E7-B440-6E39B2CDBF29}]

    - Bio.


    Please visit my blog : http://limbioliong.wordpress.com/

    Friday, May 4, 2012 3:31 PM
  • Hi, 

    And, 

    You can also perform Registration-Free Activation, how? from here  http://msdn.microsoft.com/library/ms973915.aspx.



    If this post answers your question, please click "Mark As Answer". If this post is helpful please click "Mark as Helpful".


    Saturday, May 5, 2012 5:25 AM