Error using configSource attribute.

A

Abhi

I am using Cryptography application block and am trying to use
configSource attribute to keep the config file as separate file.

my Application configuration file has following entry


App.config

<configuration>

<configSections>

<section name="dataConfiguration"
type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings,
Microsoft.Practices.EnterpriseLibrary.Data, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=null" />

<section name="securityCryptographyConfiguration"
type="Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.Configuration.CryptographySettings,
Microsoft.Practices.EnterpriseLibrary.Security.Cryptography,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" />

</configSections>

<connectionStrings configSource="data.config" />

<securityCryptographyConfiguration>

<symmetricCryptoProviders configSource="crypto.config"/>

</securityCryptographyConfiguration>

</configuration>

and external cryotography configuration file is.

crypto.config


<configuration>


<symmetricCryptoProviders>

<add name="RijndaelManaged"
algorithmType="System.Security.Cryptography.RijndaelManaged, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"

protectedKeyFilename="E:\Configuration\Configuration\bin\Debug\KeyFile.key"


protectedKeyProtectionScope="LocalMachine"
type="Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.SymmetricAlgorithmProvider,
Microsoft.Practices.EnterpriseLibrary.Security.Cryptography,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=null"

/>

</symmetricCryptoProviders>


</configuration>



in code i am calling it as


textBox2.Text = Cryptographer.EncryptSymmetric("RijndaelManaged",
textBox1.Text);



on running this i get error as.
{"Unrecognized attribute 'configSource'. Note that attribute names are
case-sensitive.
(E:\\Configuration\\Configuration\\bin\\Debug\\Configuration.vshost.exe.config
line 10)"}

Although similer setting is working with database application block.

Thanks
Abhi.
 
G

Guest

It loooks to me like you are using the vshost.exe.config file instead of the
application's config file which would be <applicationName>.exe.config
Peter
 

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

Top