Missing Assembly Reference .NET 3.5

Posted on 2012-09-18
Last Modified: 2012-09-19
I am tryng to create some SQL Database objects programmatically using C# in Visual Studio 2008. The "Management" namespace is missing and this is preventing me from accessing the needed classes.  How can I remedy this problem, which I suspect is due to  a problem in the Global Assembly Cache ?

using System;
using System.Data;
using System.Data.SqlClient;
using Microsoft.SqlServer;
using Microsoft.SqlServer.Management.Common
using Microsoft.SqlServer.Management.Smo

namespace ConsoleCreateSqlDataBase
    class Program
        static void Main(string[] args)
            string sqlConnectString = "Data Source=(local);" +
                "Integrated security=SSPI;";

            //Use SMO to create database
            Console.WriteLine("--Create Database using SMO--");
            Server server = new Server("(local)");

Error      1      The type or namespace name 'Management' does not exist in the namespace 'Microsoft.SqlServer' (are you missing an assembly reference?)
Question by:Stoutfellow
    LVL 23

    Accepted Solution


    Check this MSDN article -

    Hope it helps u...

    Author Closing Comment

    Thanks roopeshreddy! I had failed to add the needed assembly references to the Solution Explorer (blush).

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
    This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
    Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
    Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now