Enterprise Library exception: The configuration section securityCryptographyConfiguration is not def

J

Jess Chadwick

I am attempting to use the Enterprise Library (Jan 2006) Cryptography block
to encrypt a credit card number in my ASP.NET 2.0 Commerce Server
application. Everything is configured correctly, as evidenced by the fact
that it is running on a production box using the same web.config (but not
the same parent web.config). When I call the EncryptSymmetric() method, I
get this error:

Server Error in '/Store' Application.
--------------------------------------------------------------------------------

The configuration section securityCryptographyConfiguration is not defined
in the current configuration for the AppDomain.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Configuration.ConfigurationErrorsException: The
configuration section securityCryptographyConfiguration is not defined in
the current configuration for the AppDomain.

Source Error:

[No relevant source lines]

Source File: **************** Omitted ************************** Line:
933

Stack Trace:

[ConfigurationErrorsException: The configuration section
securityCryptographyConfiguration is not defined in the current
configuration for the AppDomain.]
Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.CryptographyConfigurationView.get_CryptographySettings()
+202
Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.CryptographyConfigurationView.GetSymetricCryptoProviderData(String
symetricCryptoProviderName) +130
Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.SymmetricCryptoProviderCustomFactory.GetConfiguration(String
name, IConfigurationSource configurationSource) +59
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.AssemblerBasedCustomFactory`2.Create(IBuilderContext
context, String name, IConfigurationSource configurationSource,
ConfigurationReflectionCache reflectionCache) +51
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.AssemblerBasedCustomFactory`2.CreateObject(IBuilderContext
context, String name, IConfigurationSource configurationSource,
ConfigurationReflectionCache reflectionCache) +16
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.ConfiguredObjectStrategy.BuildUp(IBuilderContext
context, Type t, Object existing, String id) +71
Microsoft.Practices.ObjectBuilder.BuilderStrategy.BuildUp(IBuilderContext
context, Type typeToBuild, Object existing, String idToBuild) +93
Microsoft.Practices.ObjectBuilder.SingletonStrategy.BuildUp(IBuilderContext
context, Type typeToBuild, Object existing, String idToBuild) +235
Microsoft.Practices.ObjectBuilder.BuilderStrategy.BuildUp(IBuilderContext
context, Type typeToBuild, Object existing, String idToBuild) +93
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.ConfigurationNameMappingStrategy.BuildUp(IBuilderContext
context, Type t, Object existing, String id) +88
Microsoft.Practices.ObjectBuilder.BuilderBase`1.DoBuildUp(IReadWriteLocator
locator, Type typeToBuild, String idToBuild, Object existing, PolicyList[]
transientPolicies) +339
Microsoft.Practices.ObjectBuilder.BuilderBase`1.BuildUp(IReadWriteLocator
locator, Type typeToBuild, String idToBuild, Object existing, PolicyList[]
transientPolicies) +194
Microsoft.Practices.ObjectBuilder.BuilderBase`1.BuildUp(IReadWriteLocator
locator, String idToBuild, Object existing, PolicyList[] transientPolicies)
+111
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory.BuildUp(IReadWriteLocator
locator, String id, IConfigurationSource configurationSource) +170
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory.BuildUp(String
id, IConfigurationSource configurationSource) +64
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.NameTypeFactoryBase`1.Create(String
name) +52
Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.Cryptographer.EncryptSymmetric(String
symmetricInstance, Byte[] plaintext) +236
Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.Cryptographer.EncryptSymmetric(String
symmetricInstance, String plaintext) +161
[ Additional lines omitted... ]



My web.config contains the following (relevant) sections:
<configuration>

<configSections>

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

</configSections>

<securityCryptographyConfiguration>

<symmetricCryptoProviders>

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

protectedKeyFilename="C:\webstore.key"

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

name="RijndaelManaged" />

</symmetricCryptoProviders>

</securityCryptographyConfiguration>

</configuration>
 
S

Steven Cheng[MSFT]

Hello Jess,

Regarding on this issue, I've also seen your another duplicated thread in
the microsoft.public.dotnet.distributed_apps newsgroup. I've posted some
suggestion here. Please feel free to followup there if you have any further
questions or finding.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 

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,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top