© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•15mo ago•
4 replies
simon

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Data.SqlClient

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Data.SqlClient=5.0.0.0 even when i use 5.2.2

So, i create a little web-api (.net 8) which only will be available to other services on the published server.
When it's finished it should access some db-tables and create excel-files out of them - depending on request params.
It's really simple, it only requires ClosedXML (not yet added) & Microsoft.Data.SqlClient

Locally all works fine, but when publishing project, i get this error (see above).
I tried everything from self-contained, updating .net runtime, stackoverflow tips, ... but nothing worked
Switched also to SqlClient 6.0.0-preview, still says 5.0.0.0 is missing.
class.cs3.31KB
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly
C#CC# / help
3y ago
FileNotFoundException: Could not load file or assembly 'System.Data.SqlClient, Version=0.0.0.0, Cult
C#CC# / help
11mo ago
❔ System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Runtime, Version=6.0.0.0
C#CC# / help
3y ago
✅ FileNotFoundException: Could not load file or assembly. The system cannot find the file specified.
C#CC# / help
17mo ago