I am trying with this command;
aspnet_regiis -pe "connectionStrings" -app "/wsMenupricing". (IN this folder is the Web.config file.)
To create the web.config with the encrypted passwords and usernames. But I et every time the message:
A configuation file cannot be created for the requested Configuation Object.
Thanks.
Niels
albert albertPosted Jan 22, 2014, 5:48 AM
is changed to this:
to this:
But in the encrypted file the Data Source=database is also encrypted. What not has to be encrypted.
So how to do that?
Thanks
albert albertPosted Jan 22, 2014, 5:01 AM
yes, but we are using an application "Bob" that checks if every project build properly. We have a dealerPortal that contains several projects. So that is why we are using Bob - that checks if every project build properly. But Bob also convert automatically every servername to IP address for the local applications.
Niels
Biswa Pujarini MohapatraPosted Jan 22, 2014, 4:16 AM
albert albertPosted Jan 22, 2014, 4:12 AM
thanks for your replay.
I have solved like this: C:\windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -pef connectionStrings "string userpad".
But the problem is. That I work in a team of 4 other developers. And we are using. SVN. SO I check the changed web.config in and other team member is doing laterst version. And then the member get this error:
Server Error in '/' Application.
________________________________________
System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Configuration.ConfigurationErrorsException: Failed to decrypt using provider 'RsaProtectedConfigurationProvider'. Error message from the provider: Bad Data.
(d:\ontwikkeling\chris\partone\dev\wspartone\web.config line 34) ---> System.Security.Cryptography.CryptographicException: Bad Data.
at System.Security.Cryptography.CryptographicException.ThrowCryptographicException(Int32 hr)
at System.Security.Cryptography.RSACryptoServiceProvider.DecryptKey(SafeKeyHandle pKeyContext, Byte[] pbEncryptedKey, Int32 cbEncryptedKey, Boolean fOAEP, ObjectHandleOnStack ohRetDecryptedKey)
at System.Security.Cryptography.RSACryptoServiceProvider.Decrypt(Byte[] rgb, Boolean fOAEP)
at System.Security.Cryptography.RSAPKCS1KeyExchangeDeformatter.DecryptKeyExchange(Byte[] rgbIn)
at System.Security.Cryptography.Xml.EncryptedXml.DecryptKey(Byte[] keyData, RSA rsa, Boolean useOAEP)
at System.Security.Cryptography.Xml.EncryptedXml.DecryptEncryptedKey(EncryptedKey encryptedKey)
at System.Security.Cryptography.Xml.EncryptedXml.GetDecryptionKey(EncryptedData encryptedData, String symmetricAlgorithmUri)
at System.Security.Cryptography.Xml.EncryptedXml.DecryptDocument()
at System.Configuration.RsaProtectedConfigurationProvider.Decrypt(XmlNode encryptedNode)
at System.Configuration.ProtectedConfigurationSection.DecryptSection(String encryptedXml, ProtectedConfigurationProvider provider)
at System.Configuration.Internal.InternalConfigHost.System.Configuration.Internal.IInternalConfigHost.DecryptSection(String encryptedXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedConfigSection)
at System.Configuration.Internal.DelegatingConfigHost.DecryptSection(String encryptedXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedConfigSection)
at System.Configuration.BaseConfigurationRecord.CallHostDecryptSection(String encryptedXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedConfig)
at System.Configuration.RuntimeConfigurationRecord.CallHostDecryptSection(String encryptedXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedConfig)
at System.Configuration.BaseConfigurationRecord.DecryptConfigSection(ConfigXmlReader reader, ProtectedConfigurationProvider protectionProvider)
--- End of inner exception stack trace ---
at System.Configuration.BaseConfigurationRecord.EvaluateOne(String[] keys, SectionInput input, Boolean isTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult)
at System.Configuration.BaseConfigurationRecord.Evaluate(FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult, Boolean getLkg, Boolean getRuntimeObject, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
at System.Web.HttpContext.GetSection(String sectionName)
at System.Web.Configuration.HttpConfigurationSystem.GetSection(String sectionName)
at System.Web.Configuration.HttpConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String configKey)
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at System.Configuration.ConfigurationManager.get_ConnectionStrings()
at System.Configuration.PrivilegedConfigurationManager.get_ConnectionStrings()
at System.Configuration.LocalFileSettingsProvider.GetPropertyValues(SettingsContext context, SettingsPropertyCollection properties)
at System.Configuration.SettingsBase.GetPropertiesFromProvider(SettingsProvider provider)
at System.Configuration.SettingsBase.GetPropertyValueByName(String propertyName)
at System.Configuration.SettingsBase.get_Item(String propertyName)
at System.Configuration.ApplicationSettingsBase.GetPropertyValue(String propertyName)
at System.Configuration.ApplicationSettingsBase.get_Item(String propertyName)
at wsPartOne.My.MySettings.get_wsPartOne_refLogin_LoginService() in D:\ontwikkeling\chris\PartOne\Dev\wsPartOne\My Project\Settings.Designer.vb:line 63
at wsPartOne.refLogin.LoginService..ctor() in D:\ontwikkeling\chris\PartOne\Dev\wsPartOne\Web References\refLogin\Reference.vb:line 60
at wsPartOne.AuthorizationService.ScalarLoginPogingAantalByIpnummer(String ipNummer) in D:\ontwikkeling\chris\PartOne\Dev\wsPartOne\AuthorizationService.vb:line 133
--- End of inner exception stack trace ---
So it seems that is only working on a local pc :(
Abhay ShankerPosted Jan 21, 2014, 11:41 PM
not sure but can check you
Apparently no one else is having this problem. And, I suppose I know why! It turns out that I needed to go to my physical directory, in this example, c:\dir\virtual\myWebsite, and then right click and open the properties page. From there, select Web Sharing and then click the radio button beside the "Share this folder". I accepted the default properties, but to see what they were I clicked on the "Edit Properties" button. The properties I accepted were Read access permission and scripts application permission. Once I did this, then the aspnet_regiis command worked fine and I got no errors.
apart of this you can also check below link
http://msdn.microsoft.com/en-us/library/bf7sd233(v=vs.80).aspx
http://forums.asp.net/t/1893132.aspx/1?storing+connection+string+in+web+config+
http://www.kodyaz.com/articles/add-connection-string-to-web-configuration-file.aspx
http://forums.asp.net/t/1359643.aspx/1
albert albertPosted Jan 21, 2014, 11:01 AM
I als try this:
C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -pef connectionStrin
gs "/wsMenupricing"
But then I get this error: The configuration for physical path '/wsMenupricing' cannot be opened.
Failed!
Biswa Pujarini MohapatraPosted Jan 21, 2014, 10:21 AM
http://stackoverflow.com/questions/8481562/aspnet-regiis-pe-cannot-find-my-configuration-section-in-net-v4-0-30319
albert albertPosted Jan 21, 2014, 9:44 AM
C:\>aspnet_regiis -pe "connectionStrings ." -app "/WsMenupricing"
I get the error: The configuration section 'connectionStrings .' was not found.
Failed!
But I have a section in web.config: