执行migration 提示Instance failure

An error occurred while accessing the Microsoft.Extensions.Hosting services. Continuing without the application service provider. Error: Instance failure.

看了看是数据库连接字符串的问题,连接字符串在appsettings文件中,系统将我的

Server=localhost\\SQLEXPRESS;Database=abc;Trusted_Connection=True;

转义成了

Server=localhost\\\\SQLEXPRESS;Database=abc;Trusted_Connection=True;

斜杠的问题。

 

对于migration其他怪问题,如果你确定不是自己的问题,重启vs后再尝试,偶尔也能解决问题。

posted @ 2023-01-30 17:07  土豆365  阅读(968)  评论(0)    收藏  举报