title: Entity Framework: System.ArgumentException: Format of the initialization string does not conform to specification starting at index 0
body: <p>I want to update my migrated database on my Asp.Net Core MVC Application, but I get the following error when I try to do this:</p>
  
  <p>I have already tried a few tutorials or forum posts but unfortunately it didn't work. Could someone help me please?</p>
  
  <p>That's my Startup.cs:</p>
  
  <pre><code>using Microsoft.AspNetCore.Builder;
  using Microsoft.AspNetCore.Hosting;
  using Microsoft.AspNetCore.Mvc;
  using Microsoft.EntityFrameworkCore;
  using Microsoft.Extensions.DependencyInjection;
  using Newtonsoft.Json.Serialization;
  using PlaudertischSoftware.Models;
  using Pomelo.EntityFrameworkCore.MySql;
  using Microsoft.Extensions.Configuration;
  using Microsoft.AspNetCore.HttpOverrides;
  using System.Net;
  using Microsoft.AspNetCore.Http;
  
  namespace PlaudertischSoftware
  {
      public class Startup
      {
          public Startup(IConfiguration configuration)
          {
              Configuration = configuration;
          }
          public IConfiguration Configuration { get; }
  
          public void ConfigureServices(IServiceCollection services)
          {
              services.Configure&lt;CookiePolicyOptions&gt;(options =&gt;
              {
                  options.CheckConsentNeeded = context =&gt; true;
                  options.MinimumSameSitePolicy = SameSiteMode.None;
              });
              services.AddRazorPages();
              services.AddMvc()
                  .SetCompatibilityVersion(CompatibilityVersion.Version_3_0);
              services.AddMvc(option =&gt; option.EnableEndpointRouting = false);
              services.AddDbContext&lt;DatenbankKontext&gt;(options =&gt;
              options.UseSqlServer(Configuration.GetConnectionString("MyConnectionString")));
              services.AddControllersWithViews()
                  .AddJsonOptions(options =&gt;
                  {
              options.JsonSerializerOptions.PropertyNamingPolicy = null;
                  });
              services.Configure&lt;ForwardedHeadersOptions&gt;(options =&gt;
              {
                  options.KnownProxies.Add(IPAddress.Parse("0.0.0.0"));
              });
  
          }
          public void Configure(IApplicationBuilder app, IHostingEnvironment env)
          {
              if (env.IsDevelopment())
              {
                  app.UseDeveloperExceptionPage();
              }
  
              app.UseStaticFiles();
              app.UseCookiePolicy();
  
              app.UseMvc(routes =&gt;
              {
                  routes.MapRoute(
                      name: "default",
                      template: "{controller=Home}/{action=Index}/{id?}");
              });
              app.UseForwardedHeaders(new ForwardedHeadersOptions
              {
                  ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
              });
  
              app.UseAuthentication();
          }
      }
  }
  </code></pre>
  
  <p>Here's my Program.cs:</p>
  
  <pre><code>using Microsoft.AspNetCore;
  using Microsoft.AspNetCore.Hosting;
  using Microsoft.AspNetCore.Server.HttpSys;
  using Microsoft.EntityFrameworkCore;
  using Microsoft.Extensions.Configuration;
  using Microsoft.Extensions.Hosting;
  using PlaudertischSoftware.Models;
  using System.IO;
  
  namespace PlaudertischSoftware
  {
      public class Program
      {
          public static void Main(string[] args)
          {
              var host = new WebHostBuilder()
                 .UseKestrel()
                 .UseUrls("http://*:5000")
                 .UseContentRoot(Directory.GetCurrentDirectory())
                 .UseIISIntegration()
                 .UseStartup&lt;Startup&gt;()
                 .Build();
  
              host.Run();
          }
      }
  }
  </code></pre>
  
  <p>My ContextFactory:</p>
  
  <pre><code>using Microsoft.EntityFrameworkCore;
  using Microsoft.EntityFrameworkCore.Design;
  using Microsoft.EntityFrameworkCore.Infrastructure;
  using PlaudertischSoftware.Models;
  
  namespace PlaudertischSoftware
  {
      public class DatenbankKontextFactory : IDesignTimeDbContextFactory&lt;DatenbankKontext&gt;
      {
          public DatenbankKontext CreateDbContext(string[] args)
          {
              var optionsBuilder = new DbContextOptionsBuilder&lt;DatenbankKontext&gt;();
              optionsBuilder.UseSqlServer("MyConnectionString");
  
              return new DatenbankKontext(optionsBuilder.Options);
          }
      }
  }
  </code></pre>
  
  <p>That's my appsettings.json:</p>
  
  <pre><code>{
    "Logging": {
      "LogLevel": {
        "Default": "Information",
        "Microsoft": "Warning",
        "Microsoft.Hosting.Lifetime": "Information"
      }
    },
    "AllowedHosts": "*",
    "ConnectionStrings": {
      "MyConnectionString": "Server=(localdb)\\mssqllocaldb;Database=MyConnectionString;Integrated Security=True"
    }
  }
  </code></pre>