SQL Server 2019 SMO error on client PC

Allison S 6 Reputation points
2022-05-25T15:30:05.543+00:00

I have a question regarding SQL Server 2019 SMOs. Our software is a .NET application (C#) that is using the SQL Server SMOs which was developed using Visual Studio 2005 and SQL Server 2008 R2. We are in the process of upgrading our development environment to Visual Studio 2019 and SQL Server 2019. I have installed the Nuget package Microsoft.SQLServer.SQLDataManagementObjects 161.47008.0 on my development PC and the project build fine, but when I tried to test our software on the target computer (Client PC), I got the error:

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.SqlServer.Smo, Version=15.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.SqlServer.Smo, Version=15.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'

Do I need to install the Microsoft.SQLServer.SQLDataManagementObjects Nuget package on the client PC as well? If yes, how?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,756 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. CathyJi-MSFT 21,096 Reputation points Microsoft Vendor
    2022-05-26T06:37:00.163+00:00

    Hi @Allison S ,

    This occurs when there are missing components because the SQL Management Object version is incorrect. Install the required SQL Shared Management Object version; see Installing SMO for details.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".