I am using Visual Studio 2022 – 17.9.6.
When I try to modify or add either a typed dataset or an entity framework (v 6) model from an existing SQL Server database, I get an error regarding a trusted certificate which most likely comes from Microsoft.Data.SQLClient. I am not using that driver at all for data access. Also, I can connect to the database fine in the same application. In other words, say I have a typed dataset that works fine when debugging, it only gives me an error when I attempt to modify the typed dataset or add a new tableadapter.
In both cases, these are .Net Framework 4.8 projects.
The typed dataset error when I try to change the CommandText for a query: a connection was established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 – the certificate chain was issued by an authority that is not trusted.)
Adding entity framework to a new project gives a similar error after choosing the data connection in the wizard, but it makes a reference to Microsoft.Data.SQLClient. See below:
Somehow, I do not have this problem when altering an already existing entity framework model. I only get that error when adding a new one.
Where is the reference to the Microsoft.Data.SQLClient coming from if there aren’t any references to it?
I have tried repairing my install as well as updating Visual Studio. I would like to avoid uninstalling and reinstalling if possible.
I have also tried uninstalling extensions. The only one that could be an issue looks like SQL Server Data Tools – SQL Editor. That does not seem to stay uninstalled nor does it seem likely to be at issue.
I tried adding trustServerCertificate=true and Encrypt = False to the connection string, but that didn’t and shouldn’t make a difference because the program still connects to the database fine. I only have an issue when I try to make the above changes.
I did find something about a possibly related bug in Visual Studio, but I cannot find it now and it was supposed to have been fixed in an earlier version anyhow.