G
Guest
I've been beating my head against the wall trying to do what appears to be
really straight forward. I've been attempting the Walkthrough: Creating and
Exporting an RSA Key Container
(http://msdn2.microsoft.com/en-us/library/2w117ede.aspx). Steps 1-3 work
fine but step 4 fails every time:
1. Create new machine-level RSA key container works just fine
(aspnet_regiis -pc "MyKeys" -exp)
2. Grant Read Access to an RSA Encryption Key works just fine
(aspnet_regiis -pa "MyKeys" "NT AUTHORITY\NETWORK SERVICE")
(aspnet_regiis -pa "MyKeys" "DEVMACHINE\ASPNET")
3. Specify a Protected Configuration Provider works just fine (site runs
fine under IIS, can browse from local and remote IE)
In <configuration> section of web.config:
<connectionStrings>
<add name="SqlServices" connectionString="Data
Source=localhost;Integrated Security=SSPI;Initial Catalog=Northwind;" />
</connectionStrings>
<configProtectedData>
<providers>
<add name="MyProvider"
type="System.Configuration.RsaProtectedConfigurationProvider,
System.Configuration, Version=2.0. 0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a,
processorArchitecture=MSIL"
keyContainerName="MyKeys"
useMachineContainer="true" />
</providers>
</configProtectedData>
4. Encrypt sections of web.config fails every time with message:
Encrypting configuration section...
The given assembly name or codebase was invalid. (Exception from HRESULT:
0x80131047)
Failed!
Every way I try fails the same way
(aspnet_regiis -pe "connectionStrings" -app "/MyWebSite" -prov "MyProvider")
(aspnet_regiis -pef "connectionStrings" "c:\inetpub\wwwroot\MyWebSite" -prov
"MyProvider")
(I'm running XP pro w/SP2, VS 2005, .Net Framework v2.0.50727, IIS 5.1,
windows update is current)
What does this error mean in this situation and how do I go about figuring
out what the problem is?
really straight forward. I've been attempting the Walkthrough: Creating and
Exporting an RSA Key Container
(http://msdn2.microsoft.com/en-us/library/2w117ede.aspx). Steps 1-3 work
fine but step 4 fails every time:
1. Create new machine-level RSA key container works just fine
(aspnet_regiis -pc "MyKeys" -exp)
2. Grant Read Access to an RSA Encryption Key works just fine
(aspnet_regiis -pa "MyKeys" "NT AUTHORITY\NETWORK SERVICE")
(aspnet_regiis -pa "MyKeys" "DEVMACHINE\ASPNET")
3. Specify a Protected Configuration Provider works just fine (site runs
fine under IIS, can browse from local and remote IE)
In <configuration> section of web.config:
<connectionStrings>
<add name="SqlServices" connectionString="Data
Source=localhost;Integrated Security=SSPI;Initial Catalog=Northwind;" />
</connectionStrings>
<configProtectedData>
<providers>
<add name="MyProvider"
type="System.Configuration.RsaProtectedConfigurationProvider,
System.Configuration, Version=2.0. 0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a,
processorArchitecture=MSIL"
keyContainerName="MyKeys"
useMachineContainer="true" />
</providers>
</configProtectedData>
4. Encrypt sections of web.config fails every time with message:
Encrypting configuration section...
The given assembly name or codebase was invalid. (Exception from HRESULT:
0x80131047)
Failed!
Every way I try fails the same way
(aspnet_regiis -pe "connectionStrings" -app "/MyWebSite" -prov "MyProvider")
(aspnet_regiis -pef "connectionStrings" "c:\inetpub\wwwroot\MyWebSite" -prov
"MyProvider")
(I'm running XP pro w/SP2, VS 2005, .Net Framework v2.0.50727, IIS 5.1,
windows update is current)
What does this error mean in this situation and how do I go about figuring
out what the problem is?