-
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
File Version for Package Microsoft.Data.SqlClient 5.1 lists as 5.0 #1945
Comments
Hi @DataJuggler, thanks for bringing this issue to our attention. I tried your project from your repo, and was able to see the same observation and when inspected nuget package for |
Thank you very much. Problems that work in Visual Studio and not in deployment are always the hardest to solve. |
Microsoft.Data.SqlClient 5.1.1 version, we release to azure container ,and got the same error. Detail:System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Data.SqlClient, Version=5.0.0.0, Culture=neutral, PublicKeyToken=23ec7fc2d6eaa4a5'. The system cannot find the file specified.\n\nFile name: 'Microsoft.Data.SqlClient, Version=5.0.0.0, Culture=neutral, PublicKeyToken=23ec7fc2d6eaa4a5'\n at Thea.Trolley.SqlServerProvider.CreateConnection(String connectionString)\n at Thea.Trolley.OrmDbFactory.Create(String dbKey, Nullable |
Direct use 'dotnet PA.Account.Api.dll' runs do not report errors,using the docker container 'docker run -d -p 8000:80 --name account -e ASPNETCORE_ENVIRONMENT=Sandbox account:latest' will result in an error。 System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Data.SqlClient, Version=5.0.0.0, Culture=neutral, PublicKeyToken=23ec7fc2d6eaa4a5'. The system cannot find the file specified.\n\nFile name: 'Microsoft.Data.SqlClient, Version=5.0.0.0, Culture=neutral, PublicKeyToken=23ec7fc2d6eaa4a5'\n at Thea.Trolley.SqlServerProvider.CreateConnection(String connectionString)\n at Thea.Trolley.OrmDbFactory.Create(String dbKey, Nullable1 tenantId)\n at PA.Account.Api.Controllers.SignInController.CreateToken(String account) in /home/vsts/work/1/s/src/PA.Account.Api/Controllers/SignInController.cs:line 410\n at lambda_method6(Closure , Object )\n at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask1 actionResultValueTask)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()\n--- End of stack trace from previous location ---\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)\n at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)\n at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)\n at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)\n at Thea.Web.TheaWebMiddleware.Invoke(HttpContext context) |
I still don't have a solution for this. |
I resolved this in one of my projects, by opening (ProjectNames).deps.json (or something close to that). One of the .NET 6.0 reference entries listed assemblyversion of Microsoft.Data.SqlClient at 5.0.0. I think when I updated this project to .NET 7, this entry is not erased and thus caused the problem. At least I know how to fix it now. Checking the installer versions soon to see if they are fixed. |
@byronbennett this has been addressed and will be available in next preview release. |
I was finally able to solve this today. What worked was changing the deps.json file to 5.1.1, even though the .dll itself lists as 5.0.0 for File Version: "runtime": { I still hope this is corrected in Microsoft.Data.SqlClient, but at least I am able to make a release version for my project now. |
Thank you for fixing this in 5.1.2 |
@jmb-mage yes, EF Core 6. But what are you waiting for? You can just add an explicit reference to 5.1.2. |
We updated the version to 5.1.2 but still getting the below error |
Was this reverted in 5.1.2?
I'm not really brave enough to hand edit my deps... |
I'm using .net 8 and the 5.2.1 package and the problem persists: Microsoft.Data.SqlClient is not supported on this platform. This is happening with a Class Library project in the release. |
Same issue in .Net 7 and Microsoft.Data.SqlClient 5.2.1 I edit deps.json to 5.2.1.0 but still not working and get Microsoft.Data.SqlClient is not supported on this platform. |
@diegoaraujolima Could you provide a repro, please? |
@DataJuggler Could you please provide the steps to reproduce the issue. I have cloned the repro from your repository. However, I have not been able to reproduce the issue. |
I fixed the problem as described above by fixing the deps.json file in the project. One of the old commits has the problem, but sorry I didn't record which commit version. |
@DataJuggler I have downloaded the DBCompare 7.02 version source code. However, I can not find the supposedly deps.json file. Could you provide the repro please with the issue that can be reproduced. As well, please provide the exact steps you took to get the error message. This will help us to understand the root cause because at this time, even with version 5.1.0, which shows the difference in File Versions and Product versions, it still works in my test project that I published and ran the executable in the published folder. |
I encountered this problem using a .NET 8 library project, only with the published version. I enabled ReadyToRun option in my publish configuration and the problem went away. If that can help someone... |
@LeDahu22 , Could you provide a repro project, please? I tried to reproduce the issue but could not. If you can provide a project that reproduces the issue, it will help us identify the root cause. |
The issue is not reproducible, so it is being closed. Feel free to re-open and provide a repro. |
Describe the bug
My actual bug is a release version of my opensource project DBCompare says 'Can't find Microsoft.Data.SqlClient 5.0'.
This is strange to me, because the package that brings in Microsoft.Data.SqlClient references version 5.1.
I looked in the bin directory of my project, and Windows Explorer lists the class as File Version 5.0.0.
I recreated a new project, and added only Microsoft.Data.SqlClient 5.1, and in Windows Explorer, it lists as File Version 5.0.
This makes it harder for me to determine why the release version is not working. Is something actually looking for 5.0 version, or is the message shown for can't find 5.1 but the file version is 5.0 so it shows me the wrong message?
Here are the references from my project

When I add the file in Advanced Installer, Advanced Installer lists the file as version 5.0:
The code is here if it helps:
https://github.com/DataJuggler/DBCompare
The Release version has the problem. Install the app. Click on the Connection elipses ..., and in the Connection String Builder Form when you click the Build Connection String button is when the error happens.
It is hard to debug this 5.1 Microsoft.Data.SqlClient lists as 5.0. Not sure why the app can't find the file, the file Microsoft.Data.SqlClient is included in the install directory.
If you are seeing an exception, include the full exceptions details (message and stack trace).
To reproduce
Include a complete code listing (or project/solution) that we can run to reproduce the issue.
Partial code listings, or multiple fragments of code, will slow down our response or cause us to push the issue back to you to provide code to reproduce the issue.
Expected behavior
A clear and concise description of what you expected to happen.
Further technical details
Microsoft.Data.SqlClient version: (found on the nuget or Microsoft.Data.SqlClient.dll)
.NET target: (e.g. Framework 4.7.1, Core 2.2.2)
SQL Server version: (e.g. SQL Server 2017)
Operating system: (e.g. Windows 2019, Ubuntu 18.04, macOS 10.13, Docker container)
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: