【发布时间】:2011-03-31 02:41:51
【问题描述】:
我使用文章Creating a Flexible Configuration Section Handler 在我的应用程序中创建了一个灵活的配置节处理程序。
我还看到了这篇题为 Encrypting Custom Configuration Sections on the OdeToCode blog 的文章,内容是关于如何加密 web.config 文件的某些部分。
从第一篇文章开始,我们就有了这个 web.config 代码。
<?xmlversion="1.0"encoding="utf-8"?>
<configuration>
<configSections>
<sectionname="StyleSheetSettings_1"
type="FifteenSeconds.Core.BasicConfigurator"/>
</configSections>
<StyleSheetSettings_1>
<StyleSheets>
<Style SheetName="Page"Href="Styles/Page.css"Media="screen"/>
<StyleSheetName="Custom"Href="Styles/Custom.css"Media="screen"/>
<StyleSheetName="Print"Href="/Lib/Styles/Print.css"Media="print"/>
</StyleSheets>
</StyleSheetSettings_1>
</configuration>
我尝试使用以下代码来加密代码,使用类似于以下命令行代码的代码。
aspnet_regiis.exe -pef "StyleSheetSettings_1" C:\Test\
我收到以下错误
无法加载类型 15秒.Core.BasicConfigurator' 从程序集'System.Web, 版本=4.0.0.0,文化=中性, PublicKeyToken=b03f5f7f11d50a3a'。
任何帮助将不胜感激。
【问题讨论】:
标签: asp.net configuration web-config