encrypting a webconfig file error RRS feed

  • Question

  • User-1221602785 posted

    Whenever I try to encrypt a webconfig file on my server I get A configuration file cannot be created for the requested Configuration object.

    When I do this C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -pe "connectionStrings" -app "/TestEncrypt" -prov "DataProtectionConfigurationProvider" is there somethin in IIs I need to do to my site to make this work correctly?

    Note same thing when use 2.0.5.... framework

    Wednesday, December 28, 2011 4:13 PM


  • User-1226263862 posted

    I'm assuming you already checked this out but what I'd pay special attention to is the -site option.  If the app's web.config you are trying to encrypt is not under the DefaultWebSite or you have deleted and recreated the DefaultWebSite, the -site option will need to be specified.

    For example, when IIS is installed, a Web site named "Default Web Site" is created as site 1. In pages served from that site, the INSTANCE_META_PATH server variable returns "/LM/W3SVC/1". If you do not specify a -site option, site 1 is used.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, December 29, 2011 10:10 AM