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

后端 未结 18 1894
一向
一向 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 12:04

    I have wasted 1.5 working days on this error and in the end a coworker solved the issue by replacing User Id by Uid and password by Pwd. The updated connection string for .Net was the error for me

    0 讨论(0)
  • 2020-11-30 12:06

    I was getting this exception, fixed it by adding throwIfV1Schema: false to my DbContext constructor:

    public class AppDb : IdentityDbContext<User>
    {
        public AppDb()
            : base("DefaultConnection", throwIfV1Schema: false)
        {
        }
    }
    
    0 讨论(0)
  • 2020-11-30 12:06

    If you're using EF and Publish Profiles, you could have a blank connection string entry in your publish profile. Annoying but entirely possible.

    0 讨论(0)
  • 2020-11-30 12:07

    My issue was that my web.config file kept a reference to a deleted entity model connection so check there are not any outdated connection strings.

    0 讨论(0)
  • 2020-11-30 12:07

    An unwanted single quote was my problem. Checking the connection string from the location of the index mentioned in the error string helped me spot the issue.

    0 讨论(0)
  • 2020-11-30 12:07

    My fix was suprisingly simple and another one of those obvious when you realise what you've done. I was manually building the configuration using .NET Core/Standard in the following fashion:

    var configurationBuilder = new ConfigurationBuilder();
    var root = configurationBuilder.Build(); 
    

    and had forgotten to include the appsettings.json file that had my configuration settings in it

    configurationBuilder.AddJsonFile("appsettings.json", false);
    

    Once added, all started working once more.

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