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:

  1. open developer command prompt vs2013
  2. 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.

  1. open developer command prompt vs2013
  2. change directory c:\windows\microsoft.net\framework\v4.0.30319 using cd c:\windows\microsoft.net\framework\v4.0.30319

    1. run following command

aspnet_regiis -pef "connectionstrings" "e:\new folder\webapplication2\webapplication2"

it encrypt connection string. :)


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -