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

后端 未结 18 1893
一向
一向 2020-11-30 11:04

I uploaded my site on godaddy shared host. I can access this database from my management studio. I can\'t access this database from my site

相关标签:
18条回答
  • 2020-11-30 11:40

    I had the same error message in my localhost development with my Visual Studio. Note that everything was working when released with Microsoft Release Management (MRM). I fixed my situation by changing the initial value that was a MRM reference.

    My App.config initial value was the following:

      <connectionStrings>
        <add name="BDORA" connectionString="__token3__" />
      </connectionStrings>
    

    Locally, the application execution could not interpret the token3 reference to its real value in Tokens.xml. To make it work on my localhost, I had to force the value from token3 in Tokens.xml into the App.config file.

    0 讨论(0)
  • 2020-11-30 11:42

    I was having the same issue when accessing a published ASP.NET Web Api. In my case, I realized that when I was about to publish the Web Api, I had not indicated a connection string inside the Databases section:

    So I generated it using the three dot button, and after publishing, it worked.

    What is weird, is that for a long time I am pretty sure that there was no connection string in that configuration but it still worked.

    0 讨论(0)
  • 2020-11-30 11:43

    I had this in VS2015 and my fix was to change the first line in my WebConfig from

    <?xml version="1.0" encoding="utf-8"?>
    

    to

    <?xml version="1.0"?>
    

    Curious.

    0 讨论(0)
  • 2020-11-30 11:44

    I got below error when trying to launch application :

    Format of the initialization string does not conform to specification starting at index 57.

    And during my research I found this stack and I was able to fix this error by looking at the web config file and found there was a extra string in the passowrd. Once I removed the string I was able to access the website without any error.

    0 讨论(0)
  • 2020-11-30 11:46

    None of the listed solutions in this thread worked for me. I started getting this error after I made some changes to the connection strings section of the web.config file. (My app connects to multiple databases.) I carefully examined what changes I had made are realized I had removed the tag at the top of my list. I restored the tag at the top of my list of connection strings and the problem went away immediately. This site that was getting the error is a application that resides below the main site (https://www.domain.org/MySite). This might not fix the problem for everyone, but it did resolve the problem for me.

    0 讨论(0)
  • 2020-11-30 11:51

    For anyone who may stumble across this thread while trying to fix this same error that results by running Enable-Migrations, chances are none of the solutions above will help you (I tried them all).

    I encountered this same issue in Web API 2 after running this in PM console:

    Enable-Migrations -EnableAutomaticMigrations -ConnectionString IdentityConnection -ConnectionProviderName System.Data.SqlClient -Force
    

    I fixed it by changing it to actually use the ApplicationDbContext created in IdentityModels.

    Enable-Migrations -ContextTypeName ApplicationDbContext -EnableAutomaticMigrations -Force
    

    The interesting thing is not only does this reference the same exact connection string, but the constructor includes code that 4castle said was a potential fix (i.e., the throwIfV1Schema: false suggestion.

    Note that the -Force parameter is only being used because the Configuration.cs file already exists.

    0 讨论(0)
提交回复
热议问题