問題描述
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;";