【c#】解决“证书链是由不受信任的颁发机构颁发的”这一问题

        在学习EF Core的时候使用Update-Database时候报错显示证书链是由不受信任的颁发机构颁发的:

错误描述:

        A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - 证书链是由不受信任的颁发机构颁发的。) 

解决方法: 

直接在“数据库连接字符串最后面”增加证书信任的配置。TrustServerCertificate=true

最终成功执行: 

猜你喜欢

转载自blog.csdn.net/lihuxie/article/details/132865793