Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7984731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:21:58+00:00 2026-06-04T11:21:58+00:00

I am trying to encrypt connection string in my web.config. I have followed the

  • 0

I am trying to encrypt connection string in my web.config. I have followed the guidelines by microsoft, but it doesn’t work. http://msdn.microsoft.com/en-us/library/ff650304.aspx#paght000006_step3

After I got “encrypting configuration sections succeeded!” in command prompt. I deleted “connectionStrings” section from my web.config and kept the newly added “connectionStrings” with encrypted data.

I had two MSSQL database connection strings for Entity Framework, but I am getting an error on runtime compile saying “The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid.“

When you open up the model edmx file, and update model from database. Visual Studio displays error saying “Failed to decrypt using provider RSAProtectedConfigurationProvider….The RSA key container could not be opened.”

    <connectionStrings configProtectionProvider="RsaProtectedConfigurationProvider">
      <EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element"
        xmlns="http://www.w3.org/2001/04/xmlenc#">
        <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc" />
        <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
          <EncryptedKey xmlns="http://www.w3.org/2001/04/xmlenc#">
            <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5" />
            <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
              <KeyName>Rsa Key</KeyName>
            </KeyInfo>
            <CipherData>
              <CipherValue>..........</CipherValue>
            </CipherData>
          </EncryptedKey>
        </KeyInfo>
        <CipherData>
          <CipherValue>........</CipherValue>
        </CipherData>
      </EncryptedData>
    </connectionStrings>

——– solved, answer below. ——

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T11:22:00+00:00Added an answer on June 4, 2026 at 11:22 am

    When you run aspnet commands, the encrypted data should replace the “connectionStrings”, if it doesn’t, then it failed. aspnet_regiis -pe “connectionStrings” -app “/” -location “subfolder” -site “2”

    I ran that command, but it turns out I don’t need -location and that was incorrect.

    I should have known, when the cipher Value XML field was so small.

    However, these two commands do the trick…

    aspnet_regiis -pe “connectionStrings” -app “/” -site “2”

    aspnet_regiis -pa “NetFrameworkConfigurationKey” “IIS APPPOOL\MyApp”

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to encrypt a file using the implementation I found here: http://msdn.microsoft.com/en-us/magazine/cc164055.aspx This
Have been trying to encrypt an xml file to a string so that I
I am trying to encrypt a string but often only part of the string
Hi I am trying to Encrypt a string to invoke a web service from
I am trying to encrypt the system.web.membership element within the Web.Config of our .Net
I'm trying to programmatically encrypt configuration sections of App.config and Web.config files. In the
I'm trying to encrypt a string, save it in a file and then later
I am trying to encrypt and decrypt some simple text. But for some reason
I'm trying to encrypt an array of 256 bytes by using RSACryptoServiceProvider but I'm
Talking about javax.crypto.Cipher I was trying to encrypt data using Cipher.getInstance(RSA/None/NoPadding, BC) but I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.