"Format of the initialization string.." error

Topics: Enterprise Library Core
Sep 18, 2012 at 10:28 PM

After deploying my web code to the dev server I get this error: "Format of the initialization string does not conform to specification starting at index 0."  After doing some research about this error it seems as if it's related to an incorrect connection string.  However, the connection string works fine locally as I'm pointing to the dev database.  And I copied the web appplication to the dev server and ran the code thru VS 2010 w/o this error. 

Could this be because I'm using the Enterprise Library, ServiceLocation, Unity dlls that aren't strongly typed?

Sep 19, 2012 at 1:40 AM

Based on the message, it does seem like a connection string issue but I wouldn't think it was because the assemblies do not have a strong name (I run the debug, unsigned assemblies all the time).

You could try to find any differences between the two deployments (working vs. non-working).  Since it looks like it's a connection string problem, and this is just the dev server can you output the connection string?  If that looks OK then you could try some simple ADO.NET to open a connection and see if that is the problem.

Another strategy is to try and break the application on purpose: give an invalid connection string or remove the connection string.  Sometimes this gives an error that you wouldn't expect and can lead you to find the issues (the virtual root is point to the wrong place, another web.config is interfering with my settings, assemblise are not reloaded, etc.).

Randy Levy
Enterprise Library support engineer