user1197114
user1197114

Reputation: 63

The Configuration for physical path can not be opened

I am trying to encrypt my web.config file connectionstring details but getting error as

The configuration for physical path "Path Goes Here" can not be opened 

Here is the command that is being executed in Visual Studio Command prompt.

aspnet_regiis.exe -pef “connectionStrings” “C:\Users\Shi\Documents\ProjFolder\StudentApp\StudentApp” -prov "StudentProvider"

P.S: I have given write permission on the path and folder to everyone. What is wrong in the command?

Upvotes: 0

Views: 3804

Answers (1)

Teja
Teja

Reputation: 325

aspnet_regiis -pe "connectionStrings" -app "/SampleApplication" -prov "RsaProtectedConfigurationProvider"

If the application is already hosted on IIS, this is the way to do it. -site option can also be specified.

Make sure you have RSA key containers. Better idea is to implement it in the code so that encryption takes place when the app is called for the first time. There are many ways to do it in code.

https://msdn.microsoft.com/en-us/library/system.configuration.rsaprotectedconfigurationprovider.aspx

Upvotes: 1

Related Questions