abramlimpin
abramlimpin

Reputation: 5077

Cannot Edit Database Connection String in Visual Studio 2022

I have a very unusual bug when trying to connect to a live Azure database via Visual Studio 2022 (17.5.0) using the following connection properties:

The target database connection (read-only) is completely fine when using the Publish Database feature. However, when clicking the Edit > Advanced, Visual Studio automatically sets the Trust Server Certificate to false. The Encryption is still set to true.

I checked the same scenario using a different machine (lower VS version), but it doesn't override the connection property.

Upvotes: 10

Views: 1130

Answers (2)

Malhaar Punjabi
Malhaar Punjabi

Reputation: 783

I updated to Microsoft Visual Studio Enterprise 2022 (64-bit) - Current Version 17.9.6 , and I get this error when publishing to SQL Server. ERROR: Unable to connect to target server '.'. Please verify the connection information such as the server name, login credentials, and firewall rules for the target server.

I fixed it by: TrustServerCertificate=True (or Encrypt=Optional)

enter image description here

Upvotes: 0

Abraham
Abraham

Reputation: 548

Microsoft released a fix for this problem in May 2023. The fix now is to upgrade Visual Studio to the latest release.

From Microsoft:

A fix for this issue has been released! Install the most recent release from https://visualstudio.microsoft.com/downloads/. Thank you for providing valuable feedback which has helped improve the product.

https://developercommunity.visualstudio.com/t/SSDT-Advanced-Settings-will-not-persist/10233984

Upvotes: 2

Related Questions