I have this outstanding issue with Microsoft.Data.SqlClient. I cannot build any installer, and have a problem publishing one of my Blazor sites because the installed version is 5.1.1, but I get the 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.
File name: 'Microsoft.Data.SqlClient, Version=5.0.0.0, Culture=neutral, PublicKeyToken=23ec7fc2d6eaa4a5'
at DataAccessComponent.DataManager.DataConnector.get_ConnectionString()
at ApplicationLogicComponent.DataBridge.DataBridgeManager.PerformDataOperation(String methodName, String objectName, DataOperationMethod dataMethod, List`1 parameters) in C:\Projects\Blazor.PixelDatabase\Data\ApplicationLogicComponent\DataBridge\DataBridgeManager.cs:line 119System.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.
File name: 'Microsoft.Data.SqlClient, Version=5.0.0.0, Culture=neutral, PublicKeyToken=23ec7fc2d6eaa4a5'
at DataAccessComponent.DataManager.DataConnector.get_ConnectionString()
at ApplicationLogicComponent.DataBridge.DataBridgeManager.PerformDataOperation(String methodName, String objectName, DataOperationMethod dataMethod, List`1 parameters) in C:\Projects\Blazor.PixelDatabase\Data\ApplicationLogicComponent\DataBridge\DataBridgeManager.cs:line 119
The file is in the bin directory, and it works in Visual Studio on my machine and via Visual Studio on my VM. Via IIS, this one project gives me this error. I had to add logging to figure this out.
Here is the issue I created earlier this year
https://github.com/dotnet/SqlClient/issues/1945
This issue was created on March 6.
Today, since I still can't solve this problem 4.5 months later, I decided to try Microsoft.Data.SqlClient 5.2.x preview. I installed the project, and it works via Visual Studio on my machine. I opened the file, and it still lists the File Version as 5.0.0.
Is there a reason you do not update the File Version with the package version? I have 3 opensource projects I can't build an installer for, and one Blazor site isn't working. I even tried copying Microsoft.Data.SqlClient from one of the working projects on the same VM to no avail.
It works in Visual Studio, so something in Visual Studio is able to resolve this issue when a Windows user is present. When running via IIS, or in any of my installer packages made with Advanced Installer, I get the above error stating 5.0.0.
Please update the File Version, it only takes 5 seconds to do, or tell me how to resolve this error.
Thank you