问题描述
NET6 Code First 使用Update-database时
报错:A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - 证书链是由不受信任的颁发机构颁发的。)
解决方法
解决方案:
提示:在连接字符串后加入 Encrypt=false;或者加入trustServerCertificate=true;
string connStr1 = "Server=.;Database=demo6;Trusted_Connection=True;MultipleActiveResultSets=true;";
//变为
string connStr1 = "Server=.;Database=demo6;Trusted_Connection=True;MultipleActiveResultSets=true;Encrypt=false;";