Cannot encrypt a custom section in the configuration file

G

Guest

This problem has become a "show-stopper" for us.
I have defined a custom section for my web application that contains
sensitive data. Because of that, I want to have it encrypted in the same way
I encrypt the "connectionStrings" section using the ASPNET_REGIIS tool.

The problem is that I get an error saying that the ASPNET_REGIIS tool can't
find the assembly file that contains my custom section.

My custom section is coded like that:

public class MyCustomSection : ConfigurationSection
{
}

And declared like that in the web.config:

<configSections>
<section
name="myCustomSection"
type=" MyNamespace.MyCustomSection, MyAssembly"
allowLocation="false"
allowDefinition="MachineToApplication"/>
</configSections>

<myCustomSection>
<-- My elements with sensitive data comes here -->
</myCustomSection>

My questions are:

1) Why ASPNET_REGIIS cannot encrypt my custom section?

2) Why ASPNET_REGIIS is probing for the assembly where MyCustomSection was
declared? Isn't the tool just supposed to encrypt the text inside the custom
section?

3) If it needs the assembly where MyCustomSection was declared, how can I
make it find it? Installing the assembly into the GAC is not an option we
can do in our project.

Thanks for the help,
Marcos
 

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

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top