小编Ami*_*nda的帖子

从 .net core 6.0 连接到在 Docker 中运行的 Sql Edge Server

我一直在尝试在 .net core 6.0 中构建一个应用程序,但在将其连接到在 docker 中运行的 sql Edge 服务器时遇到问题。我一直在 mac 上运行它。

这是我在 appsettings.json 中使用的连接字符串。

"TheatreApiDb":"Server=localhost;Database=Theatre;User=SA;Password=P@ssw0rd;Trusted_Connection=True;"
Run Code Online (Sandbox Code Playgroud)

每当我尝试连接到服务器时,我都会收到此运行时错误。

Microsoft.Data.SqlClient.SqlException: "A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 35 - An internal exception was caught)" ---> System.Security.Authentication.AuthenticationException: "The remote certificate was rejected by the provided RemoteCertificateValidationCallback."
Run Code Online (Sandbox Code Playgroud)

我已经尝试了很多方法来解决这个问题,但无法解决这个问题。

尝试将端口号放入连接字符串中,但没有解析。

c# macos docker asp.net-core-webapi azure-sql-edge

4
推荐指数
1
解决办法
1051
查看次数

标签 统计

asp.net-core-webapi ×1

azure-sql-edge ×1

c# ×1

docker ×1

macos ×1