执行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后再尝试,偶尔也能解决问题。