Last post Aug 01, 2016 02:26 AM by Yohann Lu
Jul 29, 2016 05:37 AM|vdha|LINK
I am trying to encrypt the connection string that is being given in the web.config file using aspnet_regiis. So I have the Connection String as
<add name="ProConnection" connectionString="Data Source=J;User Id=T;Password=C;pooling=true;min pool size=5;Max Pool Size=60" providerName="Oracle.DataAccess.Client"/>
So I am trying to open the aspnet_regiis.exe as
aspnet_regiis -pe "connectionStrings" -app "/NewTestAPI" -prov "RsaProtectedConfigurationProvider"
aspnet_regiis -pe "connectionStrings" -app "/E:/Dropbox/NewTestAPI" -prov "RsaProtectedConfigurationProvider"
It throws an error saying "Configruation file cannot be created for the requested Configuration object.Failed!" I tried even sharing the folder
aspnet_regiis -pe "connectionStrings" -app "/\\ABC\NewTestAPI" -prov "RsaProtectedConfigurationProvider"
It throws again same error "Configruation file cannot be created for the requested Configuration object.Failed!
Jul 29, 2016 12:14 PM|vdha|LINK
Can anyone please help me with this
Aug 01, 2016 02:26 AM|Yohann Lu|LINK
From your error message, I think maybe 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.
The following tutorials for your reference.
Encrypting sections of an ASP.NET web.config:
Encrypt Configuration Sections in ASP.NET 2.0 Using RSA:
Web.config in ASP.NET 2.0: