I previously had System.Data.SqlClient, because of NuGet update I had to include Microsoft.Data.SqlClient. I don't see System.Data.SqlClient in the link you sent. So, maybe this is a dead end?
Microsoft.SqlServer.BatchParserClient, Version=14.0.0.0
Hi,
I am getting this error " System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.SqlServer.BatchParserClient, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.SqlServer.BatchParserClient, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'"
What I don't understand is, Sql 2008 is installed with BatchParser(not BatchParserClient) and my application doesn't reference BatchParserClient from anywhere, why is the application looking for Sql 2017 file? I rebuild my code with VS2017 from VS2008, if that makes any sense. I do not want to install complete SQL Server 2017 SMO as this is client machine. I just want the basic files necessary.
Can someone please help in resolving this issue?
Thank you!
5 answers
Sort by: Most helpful
-
-
Michael Taylor 53,726 Reputation points
2022-09-13T15:22:56.64+00:00 It sounds like you are referencing the newer libraries instead of the version for your SQL version. I'm going to wager that you're using NuGet to reference the SMO assemblies. Unfortunately your SQL version is too old to work with the packages in NuGet. They start at v14.
The only workaround is to remove your references to NuGet and use the version of SMO that is installed as part of the Shared Management Objects which is what older SQL versions relied on. You'll reference those from the GAC.
Refer to the following docs for more information.
-
Isha 11 Reputation points
2022-09-13T15:41:37.423+00:00 I am not using NuGet. I have reference of Microsoft.SqlServer.BatchParser version 14.0.0.0 from GAC, but I do not have any reference of Microsoft.SqlServer.BatchParserClient. I am not sure why it is complaining about Microsoft.SqlServer.BatchParserClient file not found. Can you please shed some light on this?
Thank you!
-
Isha 11 Reputation points
2022-09-13T20:09:47.86+00:00 I installed NuGet package and I am getting this error -
System.TypeInitializationException: The type initializer for 'Microsoft.Data.SqlClient.SqlAuthenticationProviderManager' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Microsoft.Data.SqlClient.ActiveDirectoryAuthenticationProvider' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Identity.Client, Version=4.22.0.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae' or one of its dependencies. The system cannot find the file specified.
at Microsoft.Data.SqlClient.ActiveDirectoryAuthenticationProvider..cctor() -
YufeiShao-msft 7,116 Reputation points
2022-09-14T06:42:53.06+00:00 Hi @Isha ,
You can refer to this doc:
SQL Server Troubleshooting: Could not load file or assembly "Microsoft.SqlServer.BatchParser"You need to ensure that you have both 32-bit and 64-bit versions of assemblies found under c:\Windows\assembly, the version=14.0.0.0
Try to download: Microsoft® SQL Server® 2017 Feature Pack, select the respective component,
x64\SQLSysClrTypes.msi-------------
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.