Cannot Edit Database Connection String in Visual Studio 2022
Asked Answered
G

2

10

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:

  • Encryption = true
  • Trust Server Certificate = true

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.

Gradygrae answered 28/2, 2023 at 1:45 Comment(4)
Just installed VS2022 (v17.5.3) and have the same problem - it's not remembering the change when I set Trust Certificate = True. This is connecting to an on-prem SQL Server, not Azure.Hefty
I ended up reverting back to using VS2019 where this works fine.Hefty
@Mike, Have you upgraded your Visual Studio since May? Did that resolve the issue?Grania
Yes, I'm running the latest VS2022, and no, the problem has not been resolved in my case.Hefty
G
2

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

Grania answered 2/2 at 6:32 Comment(1)
Im using VS2022, latest version 17.9.2 - the problem is backSexdecillion
N
0

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

Numbers answered 5/5 at 23:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.