Reputation: 8256
I am trying to encrypt some sections of the web.config file of one of my applications by using RSA encryption at user level.
So I followed all the steps listed in here and I succesfully created the provider and granted access to my application. However, I have some problems in specifying the virtual path for my application.
I run IIS 7.5 in a Windows Server 2008 R2. My application is called www.testsite.com and its ID is 4.
The aspnet_regiis tool is placed in the Windows\Microsoft.NET\Framework\[version] folder:
Therefore in order to encrypt the connectionStrings
section I run the command:
aspnet_regiis -pe connectionStrings -app "[Application Path]" -prov "myRSAProvider"
I tried as [Application Path], the followings:
And I always receive the error
The configuration for virtual path '[Application Path]' and site 'Default Web Site' cannot be opened.
Failed to map the path '[Application Path]'. Failed!
I tried to browse many resources on the web but this IIS virtual path specification is not extensively covered. In IIS6 I could get it by running aspet_regiis -lk but this command does not work anymore in IIS 7.5. May somebody help?
Upvotes: 2
Views: 2601
Reputation: 1236
You may be having two issues.
At the end of your command statement specify your site with the command -site "4" Also note that instead of the #4 you could write in your site name instead. e.g. -site "www.testsite.com"
aspnet_regiis -pe connectionStrings -app "[Application Path]" -prov "myRSAProvider" -site "4"
It is also very important that you run the command prompt as Administrator.
I had the same error you had running IIS 7.5 in a Windows Server 2008 R2 and this is what helped me.
Upvotes: 3