Encrypt custom web.config section / cannot load custom handler?

M

MichaelS

Good morning.

I am attempting to encrypt a custom section of my web.config. The error
I am getting is that aspnet_regiis can't find/load my custom assembly
which contains my custom handler.

The custom section and handler was created using this example:
http://msdn2.microsoft.com/en-us/library/zhhddkxy.aspx

The custom section is very simple:

<myCustomSection myattrib1="value" myattrib2="value" />

The handler declaration in my web.config looks as such:
<configSections>
<section name="myCustomSection"
type="MyCustomHandler.MyCustomSectionHandler,MyCustomHandler" />
</configSections>

I've confirmed that the custom handler works in a web application.

The problem I am running into is when I am attempting to encrypt the
web.config custom section. I use the command: aspnet_regiis -pe
"myCustomSection" -app "/MyWebApp".

I get the following error:
Encrypting configuration section...
An error occurred creating the configuration section handler for
myCustomSection: Could not load file or assembly 'MyCustomHandler' or
one of its dependencies. The system cannot find the file specified.
(C:\PATHTOSITE\web.config line 5)

Could not load file or assembly 'MyCustomHandler' or one of its
dependencies. The system cannot find the file specified.
Failed!
------------
Installing the Custom Handler into the GAC is not an option.
Suggestions or pointers to what I am doing wrong would be most
appreciated.

MS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top