Value cannot be null. Parameter name: connectionString appsettings.json in starter

前端 未结 14 1923
南旧
南旧 2020-12-16 10:07

I am trying to write my connection string in my appsettings.json file and bring it into my startup file but I keep getting a Value cannot be null. Parameter name: connection

14条回答
  •  渐次进展
    2020-12-16 10:37

    I got this because I had a connection string with a \ in it, which needed escaping to be a \\. So my localdb connection string was causing a load error like this:

    "DefaultConnection": "Server=(localdb)\myinstance;Integrated Security=true;Initial Catlog=my-localdb;"
    

    and was fixed by making it:

    "DefaultConnection": "Server=(localdb)\\myinstance;Integrated Security=true;Initial Catlog=my-localdb;"
    

提交回复
热议问题