Jimesh
Jimesh

Reputation: 529

The encrypted Web.config in ASP.NET MVC via aspnet_regiis.exe is throwing error

I am using aspnet_regiis.exe to encrypt my Web.config in ASP.NET MVC application.

Following is the command which I have used for encryption:

aspnet_regiis.exe -pef "appSettings" "Path"

My Web.config appSettings section is encrypted successfully.

But when I run the application it shows following error:

enter image description here

I am running my application in localhost.

Please provide me solution for the above error.

Suggestions: The controller at the time of calling the key to fetch it's value is not able to decrypt it. Thus there must be a way that the controller can read encrypted Web.config.

According to me the solution lies between providing any access or decryption of the appSettings-keyvalue with the help of any key by which it is encrypted so that the controller can read it in runtime and get it's original value.

Tried:

aspnet_regiis -pa NetFrameworkConfigurationKey "IIS APPPOOL\DefaultAppPool" -full

aspnet_regiis -pa "NetFrameworkConfigurationKey" "NT AUTHORITY\NETWORK SERVICE"

Thanking you in advance.

Upvotes: 1

Views: 378

Answers (0)

Related Questions