-
Notifications
You must be signed in to change notification settings - Fork 286
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
Could not load file or assembly Microsoft.Data.SqlClient, Version=5.0.0.0 .NET 7 Azure AppService Linux #2146
Comments
@kieren-harvey-shell thanks for bringing this up. This might be related to #2093 that we recently addressed and will be available in our next preview release. We will get back to you on this. |
I am seeing this exact issue on Windows Server 2020 Standard. (Works correctly on Windows 11 Pro dev machine.) |
I am seeing this exact issue running on a Windows Server Core 2019 container. Application is .Net8. |
@kieren-harvey-shell can you provide repro steps to help us troubleshoot this issue please? |
I'm having the same issue. It works fine in VS locally but errors when deployed. We have Windows Server 2019 for both local dev and deployment. |
Also having the same issue here! I'm building to a docker image and can reproduce it there every time, but locally running it (in VS or Rider) works fine... Note: I do see that the dll is indeed copied to my container, so that should not be a problem at all! |
I have the same issue. .NET Core 6 with EFCore 7, deployed on a linux docker image. Even if the microsoft.data.sqlclient.dll is present in the folder, it still can't find it, while on local VS on Win10 runs absolutely fine |
Having the same issue. Can someone help how to go around fixing this: Could not load file or assembly 'Microsoft.Data.SqlClient, Version=5.0.0.0, Culture=neutral, PublicKeyToken=23ec7fc2d6eaa4a5' I am using .Net Core app with Microsoft.EntityFrameworkCore, Version=7.0.20. Migrated from System.Data.SqlClient (used in SqlBulkCopy) to Microsoft.Data.SqlClient by adding explicit package reference in csproj. Now, when I run the service on my local machine, it runs fine. However, when I run this in Linux Docker Container in Azure, it fails with this error: `Error while getting config from db
I checked the folder in the Container, the Microsoft.Data.SqlClient.dll is present in the same folder. Using .Net 6 on the Docker container |
Could you confirm that you are copying all the DLLs that MDS depends on to the Docker image? |
I encountered a similar problem, and finally found out that the reason was that packaging missed the runtimes folder |
@comvir , Which runtime folder are you suggesting? How did you solve it? Can you please explain a bit. Thanks |
Closing it since is not a SqlClient issue |
Using "RUN dotnet publish "MyProject.csproj" -c Release -o /app/publish -r linux-x64" from the above post helped us resolve this issue |
At runtime, when we invoke a db context method, e.g. SaveChanges, we are always getting an issue with the Microsoft.Data.SqlClient dependency.
A .NET 7.0 app, that has a dependency on Microsoft.EntityFrameworkCore.SqlServer
EF Core version:
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: .NET 7
The error only occurs in the Linux based App service, which is published using:
dotnet publish --os: linux
dotnet sdk version: 7.0.203
Target OS: Azure AppService
Same dotnet app / sdk works as expected on local developer Windows 10 machine.
I did notice in the .deps. that get generated in the bin dir (on local dev windows 10) that there is some reference to a 5.0.0.0 (but I can't see any way to influence that):
The text was updated successfully, but these errors were encountered: