ConfigurationSection handler in different assembly
I have a library project, assembly name: ConfigAssembly There is a class SiteConfigurationSection.
I want to use it as ConfigurationSection handler.in web.config:
<section name="SF2" type="SiteConfigurationSection,ConfigAssembly,Version=3.5.0.1, Culture=neutral, PublicKeyToken=null"/>
When I run it, I get an error:
An error occurred creating the configuration section handler for SF2: Could not load type 'SiteCon开发者_开发技巧figurationSection' from assembly 'ConfigAssembly,Version=3.5.0.1, Culture=neutral, PublicKeyToken=null'.
I'm going to assume your namespace is ConfigAssembly.
You need to define your section like this. I doubt your assembly is at version 3.5.0.1 - but if it really is, then change the information below to reflect that. You also need to generate a public key token, too.
This is called Referencing a Strong-Named Assembly
<section name="SF2" type="ConfigAssembly.SiteConfigurationSection,
ConfigAssembly,, Version=1.0.0.1, Culture=neutral,
PublicKeyToken=10633fbfa3fade6e " />
精彩评论