-
Notifications
You must be signed in to change notification settings - Fork 294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SqlException thrown related to encryption not being supported for SQL LocalDB named pipes #1395
Comments
Likely related to #1312. |
This is likely related to dotnet/SqlClient#1395 and we obviously don't care about encryption here.
@martincostello I am looking at the issue and will update yo soon. |
@martincostello as I see you have build the application for net 6. Are you using VS2022? On Friday when I tested your repro I got the same error message as you mentioned, but today it worked fine. The only thing I did extra was stopping localdb and start it again. This is my localdb version: I also made a fresh clone this morning in case you have changed anything. |
I use VS 2022 locally now, but I think the GitHub Actions images still use VS 2019 in CI for I haven't actually run the PR locally myself, I can check it tomorrow on my development machine to see if it fails there too. |
This is failing for me locally. My version appears to be 15.0 from the library path, but 13.1 from the sqllocaldb tool.
|
@martincostello any progress on this issue? I am not able to repro it anymore !!! |
Just retried the linked job to update from GitHub Actions, and it's still failing: https://github.com/martincostello/sqllocaldb/runs/4328686462?check_suite_focus=true |
out of curiosity, may this warning have anything to do with the issue? |
I don't think so. That's just a warning from MSBuild about file locks when copying artifacts around during the compilation for different TFMs in parallel. |
I'm having the same issue, I use Martin's library and had System.Data.SqlClient installed in a project reference, tests worked fine, but then switched to Microsoft.Data.SqlClient 4.0 and then got 2 different errors:
And in another test:
Switching back to either System.Data.SqlClient (4.8.3) or Microsoft.Data.SqlClient 3.0.1 (previous stable before 4.0) fixes it. |
@Rubenisme thank you for updating this thread. One last question before Have you or @martincostello tried with net 5 to get connection from localdb? @Rubenisme can you provide your connection string and the sample repro? |
With version 4.0.0, no. The library's tests were targeting .NET 5 until recently, but moved to .NET 6 not long after GA. |
one more test, if you can add |
I am going to make PR to address the cause of this issue. The issue comes from the fact that driver checks if the connection string starts with |
as a work around for now, till the fix is out, if there is a way to add Encrypt=false to your connection string that would solve the issue. In the provided sample repro by @Rubenisme it happens at |
@JRahnama thank you for finding the issue so quickly, and creating a PR to fix it. Sorry I didn’t have a more minimal repo but thank you and for pinpointing the place it happens exactly. @martincostello will you update the library in the meantime or let users know about the workaround and wait for the fix on the SqlClient library? |
I won't be updating the library for this, especially with a fix coming, as users can work around it themselves. I'll point any users that file issues with the SqlLocalDb library to this issue if I get any reports. |
Got the same error message as mentioned above after updating from 3.x to 4.0.0. SQL Server is on my local machine, not sure if that if the same issue. I've added |
@KoalaBear84 Above @JRahnama says that you should use On another note:
@JRahnama if you have this implemented, can you also expose the Update: Nevermind, I realize this is an EF core thingy, and although you work for the same company and probably work somewhat close together with that team, they are still 2 different worlds. If you can expose it to them that would probably help down the road. ;) |
@Rubenisme All localdb server names have a unique pattern, that you can detect. |
@ErikEJ Well yes, I now use: |
@Rubenisme you can access that through |
@martincostello can you test with this artifact . If you do not have access use this file and change the |
Test fix for dotnet/SqlClient#1395.
@JRahnama Validated the fix with martincostello/sqllocaldb#466. |
Describe the bug
Using Microsoft.Data.SqlClient 4.0.0 with SQL LocalDB and named pipes does not work when attempting to connect to the instance.
I maintain a library that provides interop with the SQL LocalDB APIs, and upgrading its tests to version 4.0.0 is causing a number of its tests to fail.
An example of one of these failing tests is here.
To reproduce
Clone the martincostello/sqllocaldb repo on a Windows machine and checkout the
dependabot/nuget/Microsoft.Data.SqlClient-4.0.0
branch and runbuild.ps1
to run the library's build and test script.Expected behavior
The tests pass.
Further technical details
Microsoft.Data.SqlClient version:
4.0.0
.NET target:
net6.0
SQL Server version: SQL LocalDB 13
Operating system: Windows 2019
The text was updated successfully, but these errors were encountered: