question

AllisonS-4736 avatar image
0 Votes"
AllisonS-4736 asked AllisonS-4736 commented

SQL Server 2019 SMO error on client PC

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-general
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Cathyji-msft avatar image
0 Votes"
Cathyji-msft answered AllisonS-4736 commented

Hi @AllisonS-4736,

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".



· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @Cathyji-msft,
Thank you very much for your quick response. I read the Installing SMO section, but it seemed that if we choose to install the NuGet package Microsoft.SQLServer.SQLDataManagementObjects on the client PC, the only option is by using PowerShell. Is this correct?

But it seemed that we don't have to install the NuGet Package "Microsoft.SQLServer.SQLDataManagementObjects" on the target computer, what we can do is just copying the referenced SMO related DLLs and the DLLs that the referenced DLLs depend on to the same directory as our application on the Target PC will be fine.

0 Votes 0 ·