开发者

Microsoft.SqlServer.Management.Smo Namespace - what do I need to install to resolve it?

I'm picking up a support call on a legacy piece of software. It has the following imports:

using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlServer.Management.Common;

The references in the project point to:

Mic开发者_Python百科rosoft.SqlServer.ConnectionInfo
Microsoft.SqlServer.Smo

.. which are not currently being resolved and causing the compile to fail.

What do I need to download and install to get this project to compile? I do currently have SQL Server 2008 installed. I've found links such as http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=50b97994-8453-4998-8226-fa42ec403d17 but I'm not sure what to install.

A link to what is required would be much appreciated! Thanks.


You'd want to install the Management objects, which live in the XMO package:

The Management Objects Collection package includes several key elements of the SQL Server 2005 management API, including Analysis Management Objects (AMO), Replication Management Objects (RMO), and SQL Server Management Objects (SMO). Developers and DBAs can use these components to programmatically manage SQL Server 2005.

Note: Microsoft SQL Server 2005 Management Objects Collection requires Microsoft Core XML Services (MSXML) 6.0 and Microsoft SQL Server Native Client, also available on this page.

Audience(s): Customer, Partner, Developer

X86 Package (SQLServer2005_XMO.msi) - 9529 KB X64 Package (SQLServer2005_XMO_x64.msi) - 14963 KB IA64 Package (SQLServer2005_XMO_ia64.msi) - 18372 KB

But if you've already got SQL Server 2008 installed, you might have the equivalent assemblies already installed. They can be found under C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies.

I'm not sure how different the 2008 and 2005 versions are, and you probably want to ensure you don't recompile for 2008 if they're meant to be for 2005 or vice versa (although the 2008 SMO objects should let you manage 2005 server instances)


add a reference to Microsoft.SqlServer.Smo, Microsoft.SqlServer.ConnectionInfo and Microsoft.SqlServer.Management.Sdk.Sfc, located at assemblies folder inside of the sdk folder from your Sql server installation directory example: C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies


This one, towards the end of the page:

Microsoft SQL Server 2005 Management Objects Collection

The Management Objects Collection package includes several key elements of the SQL Server 2005 management API, including Analysis Management Objects (AMO), Replication Management Objects (RMO), and SQL Server Management Objects (SMO). Developers and DBAs can use these components to programmatically manage SQL Server 2005.

X86 Package (SQLServer2005_XMO.msi) - 9529 KB

X64 Package (SQLServer2005_XMO_x64.msi) - 14963 KB

IA64 Package (SQLServer2005_XMO_ia64.msi) - 18372 KB


In my visualstudio2015

Add Reference >> Assemblies >> Extension >>
microsoft.sqlserver.ConnectionInfo
microsoft.sqlserver.management.SMO 

and it works fine.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜