Registering component in the GAC

How to register component in the GAC.

1) Create an assembly that contains ConfigurationSection classes (ieConfigurationElement, ConfigurationSection.  You need to create a strongname for this assembly (for the GAC)

2) Register that assembly in the GAC using gacutil -I <filename>.dll

3) In my web.config, fully qualified the assembly:

  <configSections>
        <section name="mySection" type="MyNamespace.Section.MySection,MyNamespace.Section Version=1.0.0.0, Culture=neutral, PublicKeyToken=234324324234987" />
    </configSections>

You have to put the version and public key token, otherwise it won't work.

4) Encrypt using aspnet_regiis with the following command:

aspnet_regiis -pef "mySection" "C:\work\src\mywebsite"
By Perry    Popularity  (1682 Views)