asp.net - How to encrypt the connectstring section of web.config in MVC website? -
i want encrypt connectionstring section of web.config. have tried following below steps:
- open developer command prompt vs2013
- aspnet_regiis -pef "connectionstrings" -app "/e:\new folder\webapplication1\webapplication1"
it thorwing me error "a configuration file cannot created requested configuration object. failed"
i did google not able why facing this. have tried change permissions of website folder?
do need set website in iis? please me solve issue.
thanks in advance.
<configuration> <configprotecteddata defaultprovider="sampleprovider"> <providers> <add name="sampleprovider" type="system.configuration.rsaprotectedconfigurationprovider, system.configuration, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil" keycontainername="samplekeys" usemachinecontainer="true" /> </providers>
add above section web.config.
- open developer command prompt vs2013
change directory c:\windows\microsoft.net\framework\v4.0.30319 using
cd c:\windows\microsoft.net\framework\v4.0.30319
- run following command
aspnet_regiis -pef "connectionstrings" "e:\new folder\webapplication2\webapplication2"
it encrypt connection string. :)
Comments
Post a Comment