Contains notes and lessons in working technology, especially .NET, Azure, DevOps, Agile, and Team Foundation Server.

Wednesday, April 21, 2010

OraAspNetConString Missing Connection String Config Error

After the latest Oracle Client was installed on a fresh Windows 2008 R2 Server, any .NET applications using role or membership services would fail with an error about a missing connection string in the machine.config. The Event Log contained the following detail:

Exception information:
Exception type: ConfigurationErrorsException
Exception message: The connection name 'OraAspNetConString' was not found in the applications configuration or the connection string is empty. (C:\Windows\Microsoft.NET\Framework\v2.0.50727\Config\machine.config line 178)

After doing some digging and comparing with some of our other servers that have earlier versions of the Oracle Client tools, I discovered that the Oracle tools inject several providers and a blank connection string into the machine.config file, and thus when the .NET framework attempts to spin up the providers, these will fail.

Prior to the install, the system.web node contained the following:

image

After the Oracle Client tools install, the system.web node had been modified to include the following Oracle providers:

image

When Oracle Client is installed, notice that it adds 6 different providers into the machine.config and adds a blank connection string with a key of “OraAspNetConString”. You can either a) set the connection string to an appropriate value, or, b) remove the providers and connection string. I removed all 6 of the entries (don’t forget the Framework64 machine.config location too) and this resolved the issue.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.