Reference Microsoft.SqlServer.Smo.dll

Viewed 95306

I need to use Server class which is stored in Microsoft.SqlServer.Smo.dll I don't see this assembly in usual References dialog. I have found it at C:/Program Files/Microsoft SQL Server/100/SDK/Assemblies and try to reference from there but Visual Studio throws an error "A reference 'C:/Program Files/Microsoft SQL Server/100/SDK/Assemblies/Microsoft.SqlServer.Smo.dll' could not be added. Please make sure that file is accessible, and that it is a valid assembly or COM component". What am I doing wrong?

11 Answers

An easy way to get all 7 ddls that related on this issue is

Microsoft.SqlServer.ConnectionInfo.dll,
Microsoft.SqlServer.ConnectionInfoExtended.dll,
Microsoft.SqlServer.Management.Sdk.Sfc.dll,
Microsoft.SqlServer.Smo.dll,
Microsoft.SqlServer.SmoExtended.dll,
Microsoft.SqlServer.SqlClrProvider.dll,
Microsoft.SqlServer.SqlEnum.dll

Create a separate console application

download those using nuget

PM> Install-Package Microsoft.SQLServer.SMO -Version 12.0.2000.8

build the application and all dlls will be in the bin folder ... you can copy from there and add reference to your existing application

https://www.nuget.org/packages/Microsoft.SQLServer.SMO/12.0.2000.8

You can use: https://www.nuget.org/packages/Microsoft.SqlServer.SqlManagementObjects see installation info: https://docs.microsoft.com/nl-be/sql/relational-databases/server-management-objects-smo/installing-smo

but no idea if this is redistributable...

as it only talks about design, develop and testing:

  1. INSTALLATION AND USE RIGHTS. You may install and use any number of copies of the software on your devices to design, develop and test your programs.

https://docs.microsoft.com/nl-be/sql/relational-databases/server-management-objects-smo/smo-license-terms

To synchronize a pull subscription on demand in Management Studio Connect to the Subscriber in Management Studio, and then expand the server node.

Expand the Replication folder, and then expand the Local Subscriptions folder.

Right-click the subscription you want to synchronize, and then click View Synchronization Status.

In the View Synchronization Status - : dialog box, click Start. When synchronization is complete, the message Synchronization completed is displayed.

Click Close.

Related