We are getting this error Could not load file or assembly 'Microsoft.SqlServer.BatchParser, Version=15.100.0.0 and we need the SMO package for SQL 2019

Rashmi Mahesh 11 Reputation points
2022-03-30T11:49:19.2+00:00

We Downloaded ‘Microsoft.SqlServer.SqlManagementObjects’ with version 150.18208.0 from nuget package manager.

<package id="Microsoft.SqlServer.SqlManagementObjects" version="150.18208.0" targetFramework="net48" />

Used following dlls:
Microsoft.SqlServer.BatchParserClient.dll
Microsoft.SqlServer.ConnectionInfo.dll
Microsoft.SqlServer.Management.Sdk.Sfc.dll
Microsoft.SqlServer.Smo.dll
Microsoft.SqlServer.SqlClrProvider.dll
Microsoft.SqlServer.SqlEnum.dll

Getting below exception:
Could not load file or assembly 'Microsoft.SqlServer.BatchParser, Version=15.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Please give us the SMO package for SQL 2019

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
3,061 questions
SQL Server | Other
{count} votes

1 answer

Sort by: Most helpful
  1. Seeya Xi-MSFT 16,586 Reputation points
    2022-03-31T03:21:30.033+00:00

    Hi @Rashmi Mahesh ,

    Welcome to Microsoft Q&A!
    Please read this ducument: https://learn.microsoft.com/en-us/sql/relational-databases/server-management-objects-smo/getting-started-in-smo?view=sql-server-ver15

    Best regards,
    Seeya


    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.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.