473,785 Members | 2,167 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

aspnet_regiis fails (0x80131047) trying to encrypt connectionStrin

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?
Jul 26 '06 #1
1 4196
Never mind, I figured it out (and I can't believe more people haven't run
into this and noone's fixed the root of the problem).

Like most Walkthroughs and sample code snippets, I make a habbit of copying
from the web page and pasting into Visual Studio. The problem with this
Walkthrough is that the type property (in the add provider section of
configProtected Data) contains a space character in the part where it shows
"Version=2. 0. 0.0," (good thing aspnet_regiis gave a helpful error message!)
Anyway, removing the space ("Version=2.0.0 .0,") fixes the problem.

"Marc B." wrote:
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?

Jul 27 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2777
by: John Bergstrom | last post by:
Hello everyone! I wrote a simple perl program to encrypt a string using Crypt::OpenSSL::RSA. Everything as described in the module documentation. The public key is a valid X.509 encrypted certificate. When I tried executing the code I get the following error: -------------------
2
2897
by: WilOJoe | last post by:
Does anyone have any ideas about why the Crypto API call to CryptGetUserKey(…)would work just fine in WindowsXP but fails when executed in Windows2000? The call is made in code that is practically identical to the well known file encryption example found in the MSDN help (see ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/security/security/example_c_program_encrypting_a_file.htm if you have MSDN installed on your machine) and attempts to...
1
6169
by: Itjalve | last post by:
I cant find the errocode 0x80131047. I have installed C++ Express Beta, and when running one of my apps i get this error code. It works okay before the installation of C++ Express Beta, so I guess it has something to do with .NET 2.0.
17
4845
by: JStemper | last post by:
On one of my localhost sites I'm getting a message to run aspnet_regiis -c to correct some scripting issues. When I try to run the listed command I get another error: "You must have administrative rights on this machine in order to run this tool." I have verified that I have administrative rights on the box as my normal login. I have also logged in as the local administrator, tried the same thing and get the same message.
8
4285
by: toupeira23 | last post by:
Hello, I'm trying to encrypt passwords in my app. After discovering that there's no simple function to do this, I wrote a wrapper class which decodes a string using UTF8, encrypts it with TripleDES and returns a Base64-encoded string. The decryption function does the reverse, i.e. Base64-decodes the string, decrypts it with the same Key and IV, and encodes it again with UTF8. The problem is that after decrypting, the 8th character is...
4
3438
by: Anthony Yott | last post by:
Folks, In using the aspnet_regiis –ga command I'm running into an issue. I'm using this command against a domain account e.g. aspnet_regiis –ga MyDomain\ayott and it works fine. If I perform the command against another domain account it doesn't do anything but show all the options. I'm running XP SP2 but I'm got a virtual machine with Win2003 loaded up and I get the same exact results. Does anybody know why I can't use this command...
8
3022
by: David Thielen | last post by:
Hi; In our setup program how do I determine if I need to run "aspnet_regiis –i" and if so, is there an API I can calll rather than finding that program on the user's disk and calling it? -- thanks - dave david_at_windward_dot_net http://www.windwardreports.com
2
10337
by: rockdale | last post by:
I followed this article, http://msdn2.microsoft.com/en-us/library/zhhddkxy.aspx My command is: aspnet_regiis -pe "connectionStrings" -app "/myWebSiteName" -site 711831 -prov "RsaProtectedConfigurationProvider"
3
2028
by: MosheY | last post by:
I have Vista Business and I am trying to encrypt a connection string in the web.config file as in XP aspnet_regiis -pef.... but it does not work! I get some sort of message which I do not understand. Can someone help me?
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10162
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10100
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9959
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8988
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
4061
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2893
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.