How to fix error ::Format of the initialization string does not conform to specification starting at index 0::

It might help to see what the actual connection string is. Add to Global.asax:

throw new Exception(ConfigurationManager.ConnectionStrings["mcn"].ConnectionString);

If the actual connection string is $(ReplacableToken_mcn-Web.config Connection String_0), that would explain the problem.


I was facing the same problem and found out that my connection string had an extra double-quote character in the middle of the connection string.


I originally was calling the connection string value as shown below (VB.NET) and got the error being mentioned

 Using connection As New SqlConnection("connectionStringName") 
  '// more code would go here...
 End Using

adding a reference to System.Configuration and updating my code as shown below was my solution. The connection string was not the problem since others controls used it without any issues (SqlDataSource)

Using connection As New SqlConnection(ConfigurationManager.ConnectionStrings("connectionStringName").ConnectionString)
    '// more code would go here...
End Using