I know that ppl have already asked questions regarding encrypting web.config.
im also trying to encrypt my test config file, but im getting this error.
aspnet_re
Take a look at this , see if you set it up correctly
http://msdn.microsoft.com/en-us/library/ms998283.aspx
A possibiliity is to specify the site with -site "SiteName" otherwise it will use the default web site.
I know this is old, but I've just had the same issue and none of the other answers got the problem.
You're not supposed to put the filename in the path, and the file MUST be called web.config
. So for your example, if your web.config
file is actually in C:\
you would put:
aspnet_regiis -pef "connectionStrings" "C:\"
and your file MUST be called web.config
as the tool will only look for that file.
For those people whose file isn't in C:\
you'll need to put the full path to the file (root of the site). You'll also need to cd
into the directory containing the aspnet_regiis.exe
file or put the full file path for the tool as well:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis -pef "ConnectionStrings" "C:\Ghron\Projects\Company\trunk\project1\project1"
Also, some of the other answers are valid points - the parameters are case sensitive, so your paths and section names must be in the right case. I wasted about 20 minutes using "ConnectionStrings"
instead of "connectionStrings"
(lower case c).
I am having same issue while encrypting configuration file from a web site. Provide command to encrypt from a site and not default website. Below command works when application is in defaultwebsite: aspnet_regiis.exe -pe "connectionStrings" -app "/sitename" -prov "DataProtectionConfigurationProvider"