【发布时间】:2010-10-25 21:49:20
【问题描述】:
我目前正在尝试在我忙于的项目中实现自定义配置部分,无论我尝试什么,我都会收到以下错误:
{“为 pageAppearanceGroup/pageAppearance 创建配置节处理程序时出错:无法从程序集 'System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' 加载类型 'Samples.AspNet.PageAppearanceSection' .(E:\三九开发\lastfm\msdn\msdn\bin\Debug\Samples.Aspnet.vshost.exe.config第6行)"}
我已经从这篇 MSDN 文章中复制了代码:
http://msdn.microsoft.com/en-us/library/2tw134k3.aspx
我仍然遇到同样的错误。
我尝试了以下文章中的所有建议/指南,但无济于事。
http://www.evanclosson.com/devlog/bettercustomerrorsinaspnetcustomconfigurationsection
http://geekswithblogs.net/akraus1/articles/64871.aspx
这一定是我想念的愚蠢的东西。 我正在运行 Vista,这会是一个问题吗?一些晦涩的安全设置?
<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>
【问题讨论】:
-
如果您标记得当,即使用您正在使用的技术,您将获得更多更好的响应。
-
你的web.config好像有问题,能发一下相关的部分吗?
-
没有配置很好,我已经验证了 App.config 和 web.config 我能够从 app.config 和 web.config 中读取 appSettings jsut 很好
标签: asp.net configuration