views:

71

answers:

1

I used the article Creating a Flexible Configuration Section Handler to create a Flexible Configuration Section Handler in my application.

I also saw this article entitled Encrypting Custom Configuration Sections on the OdeToCode blog, on how to encrypt portions of a web.config file.

From the first article, we have this web.config code.

<?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>

I tried to use the following code to encrypt the code using something like the following command line code.

 aspnet_regiis.exe -pef  "StyleSheetSettings_1" C:\Test\

I am getting the following error

Could not load type FifteenSeconds.Core.BasicConfigurator' from assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

Any help would be appreciated.

A: 

trying change type to include the assembly name

type="FifteenSeconds.Core.BasicConfigurator, MyWebApplication"

This assumes the BasicConfiguration is in your Web App

Conrad Frix
After adding the assembly name type="FifteenSeconds.Core.BasicConfigurator, FifteenSeconds.Core", i am still receiving the following error.Encrypting configuration section...An error occurred creating the configuration section handler for StyleSheetSettings_1: Could not load file or assembly 'FifteenSeconds.Core' or one of its dependencies. The system cannot find the file specified.
Brad Sandefur
where is the DLL relative to the Web.Config
Conrad Frix