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\NETWO RK SERVICE")
(aspnet_regiis -pa "MyKeys" "DEVMACHINE\ASP NET")
3. Specify a Protected Configuration Provider works just fine (site runs
fine under IIS, can browse from local and remote IE)
In <configurations ection of web.config:
<connectionStri ngs>
<add name="SqlServic es" connectionStrin g="Data
Source=localhos t;Integrated Security=SSPI;I nitial Catalog=Northwi nd;" />
</connectionStrin gs>
<configProtecte dData>
<providers>
<add name="MyProvide r"
type="System.Co nfiguration.Rsa ProtectedConfig urationProvider ,
System.Configur ation, Version=2.0. 0.0,
Culture=neutral , PublicKeyToken= b03f5f7f11d50a3 a,
processorArchit ecture=MSIL"
keyContainerNam e="MyKeys"
useMachineConta iner="true" />
</providers>
</configProtected Data>
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 "connectionStri ngs" -app "/MyWebSite" -prov "MyProvider ")
(aspnet_regiis -pef "connectionStri ngs" "c:\inetpub\www root\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?