Cannot encrypt custom section in web.config

M

mnowosad

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
 
M

mukundsingh

I'm also facing the same issue. Did u get any reply on this or have u come across a solution to this problem. I'm really stuck on this problem.
 
M

mnowosad

The custom section class is defined in an assembly that is in the /bin
folder.
Putting our libraries in the GAC is not an allowed option for this
particular project, due to the policy of the web hosting company we are using.

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,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top