-
Notifications
You must be signed in to change notification settings - Fork 299
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
MARS TDS header contained errors #687
Comments
Hi @meirib , We have fixed this issue in Microsoft.Data.SqlClient v2.0.0 in this PR #547 . This fix is ported back to v1.1.3 #550 . Do you know whether the application calls the SqlDataReader or SqlBulkCopy? It may be related to some known issues we have. And if possible, an application with Microsoft.Data.SqlClient driver only will help to narrow down the investigation. |
Seems like upgrading to Microsoft.Data.SqlClient v2.0.0 solved the issue. |
@meirib Since we have the same fix both in version 2.0.0 and version 1.1.3, the EntityFrameworkCore.SqlServer (V3.1.6) should also work in your scenario.
Do you have the repo app to confirm this? |
@karinazhou For what it's worth, these are the properties: Whereas this constellation seems to be working: |
@meirib I can see that you are posting the properties of System.Data.SqlClient.dll. Is this posted by mistake? And for this working case:
It looks like you not only upgrade the Microsoft.Data.SqlClient but also upgrade the EFCore version. Could you try one more thing?
Does this issue still happen with this combination? |
@karinazhou Sorry, my mistake. This is the correct one: If I recall, the Microsoft.EntityFrameworkCore.SqlServer v3.1.6 & Microsoft.Data.SqlClient v2.0.0 combination works. |
@meirib Thank you for confirming it. From the library property you posted, it is from the \lib folder other than the actual working one from \runtimes folder. Is this the one loaded by your application when using EFCore v3.1.6 only? From all the clues we have now, we know that direct reference to the Microsoft.Data.SqlClient v2.0.0 works fine no matter what version of EFCore your application uses. And use EFCore v3.1.6 only fails the application.
Can you also try the last two combinations to validate the behavior? I have some updates from local testing. When I add Microsoft.EntityFrameworkCore.SqlServer v3.1.6 to my simple .net core console application, I find that it depends on the Microsoft.Data.SqlClient v1.0.19269.1 instead of v1.1.3: That version of the driver doesn't contain the TDS header fix which will cause the exception you have seen. If you only have reference to EFCore v3.1.6, it will use that MDS version by default. According to nuget.org, EFCore.SqlServer v3.1.7 will grab the MDS v1.1.3. https://www.nuget.org/packages/Microsoft.EntityFrameworkCore.SqlServer/3.1.7 From your testing results, it looks like the application will use the right MDS version when you explicitly specify it in your project. To verify it, you can set breakpoints in your program to see which Microfost.Data.SqlClient.dll is loaded by your application. |
Hi @meirib , |
Closing as duplicate of #85 |
@ajcvickers
Following my previous post:
dotnet/aspnetcore#24831
This error occurs spontaneously on Azure MSSQL, and only a web app restart seems to help:
Unfortunately, I'm using a 3rd party nuget that reproduces this issue, thus I cannot provide a runnable code for investigation.
However, It appears that this 3rd party uses Microsoft.EntityFrameworkCore.SqlServer (V3.1.6), which uses:
Microsoft.Data.SqlClient (V1.1.3) as it's default dependency version.
According this issue:
#85
I cannot conclude whether this issue is resolved in Microsoft.Data.SqlClient (V2.0.0) or not.
If so, an upgrade should resolve this matter?
The text was updated successfully, but these errors were encountered: