本文介绍了自定义配置部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试在我忙的项目中实现自定义配置部分,无论我试着,我一直收到以下错误:



{创建pageAppearanceGroup / pageAppearance的配置节处理程序时出错:无法从程序集System.Configuration,Version = 2.0.0.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a中加载类型Samples.AspNet.PageAppearanceSection \\ Three Nine Developments \lastfm\msdn\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\我已经从这个MSDN的Artricle复制代码:





我仍然得到错误。



我尝试了以下文章中的所有建议/指南,但无效。





这是一个愚蠢的,我失踪。
我运行Vista,这可能是一个问题?一些模糊的安全设置?

 < configuration> 
<! - 配置节 - 处理程序声明区。 - >
< configSections>
< sectionGroup name =pageAppearanceGroup>
< section
name =pageAppearance
type =Samples.AspNet.PageAppearanceSection
allowLocation =true
allowDefinition =Everywhere
/>
< / sectionGroup>
<! - 其他< section>和< sectionGroup>元素。 - >
< / configSections>

<! - 配置段设置区域。 - >
< pageAppearanceGroup>
< pageAppearance remoteOnly =true>
< font name =TimesNewRomansize =18/>
< color background =000000foreground =FFFFFF/>
< / page外观>
< / pageAppearanceGroup>



< / configuration>


解决方案

您还应该查看Jon Rista的三部分系列在.NET 2.0上配置CodeProject。









强烈推荐,写得很好,非常有帮助!



Marc


I am currently trying to implement a Custom Configuration Section in a project I am busy with and no matter what I try I keep getting the error below:

{"An error occurred creating the configuration section handler for pageAppearanceGroup/pageAppearance: Could not load type 'Samples.AspNet.PageAppearanceSection' from assembly 'System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. (E:\Three Nine Developments\lastfm\msdn\msdn\bin\Debug\Samples.Aspnet.vshost.exe.config line 6)"}

I have copied the code from this MSDN Artricle:

http://msdn.microsoft.com/en-us/library/2tw134k3.aspx

I still get the same error.

I have tried the all the advice/guide in the following articles but to no avail.
http://www.evanclosson.com/devlog/bettercustomerrorsinaspnetcustomconfigurationsection

http://geekswithblogs.net/akraus1/articles/64871.aspx

This must be something stupid that I am missing.I am running Vista, could that be a problem? some obscure security setting?

    <configuration>
  <!-- Configuration section-handler declaration area. -->
  <configSections>
    <sectionGroup name="pageAppearanceGroup">
      <section
        name="pageAppearance"
        type="Samples.AspNet.PageAppearanceSection"
        allowLocation="true"
        allowDefinition="Everywhere"
      />
    </sectionGroup>
    <!-- Other <section> and <sectionGroup> elements. -->
  </configSections>

  <!-- Configuration section settings area. -->
  <pageAppearanceGroup>
    <pageAppearance remoteOnly="true">
      <font name="TimesNewRoman" size="18"/>
      <color background="000000" foreground="FFFFFF"/>
    </pageAppearance>
  </pageAppearanceGroup>



</configuration>
解决方案

You should also check out Jon Rista's three-part series on .NET 2.0 configuration up on CodeProject.

Highly recommended, well written and extremely helpful!

Marc

这篇关于自定义配置部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-07 03:46