none
Microsoft.SqlServer.Management.Smo behaves differently in VS2010 vs VS2008 RRS feed

  • Question

  • I've just upgraded my C# winforms app from VS2008 to VS2010. It wont compile though, as it is complaining "The type of namesapce name 'Server' could not be found...". In this case, "Server" refers to "Microsoft.SqlServer.Management.Smo.Server". I try typing in the full name, but it is not there. Intelisense picks up the "Microsoft.SqlServer.Management.Smo" bit, but does not show server as an option.

    Nothing else has changed between it working and not working, than upgrading it to VS2010. Whats going on here? What do I have to do to get it working?

    Interestingly, when I go to "Add Reference", I cant see any of the Microsoft.SqlServer stuff in VS2010, but I can in VS2008.

    Some other information:

    Target Framework: 2.0.

    SqlServer.Management version: 10.0.0.0.

    Monday, May 6, 2013 10:56 AM

Answers

  • I've managed to sort it out. This posting kind of answered it for me:
    http://social.msdn.microsoft.com/Forums/en-US/sqlsmoanddmo/thread/cc7a0cf0-8ddd-455b-9075-2a92f2716a05

    I needed to install the SQL Server 2005 Feature pack, and use those dll's.

    It all seems kind of odd. When using VS2008, I could use the SQL Server 2008 feature pack just fine. After upgrading to VS2010, I needed to downgrade my SQL Feature pack to 2005.
    • Marked as answer by fweeee Tuesday, May 7, 2013 11:44 AM
    Tuesday, May 7, 2013 11:44 AM

All replies

  • Bit more information. I'm using VS2010 Professional, Version 10.0.40219.1 SP1Rel.

    I just downloaded and installed the SQL Server Data tools from here: http://msdn.microsoft.com/en-us/jj650014, to no avail.

    -- EDIT --

    Bit more information. When I first open the application, all seems fine. The refernces to "Server" display in the aqua colour, indicating all fine - VS recognises it. When I mouse over it, it tells me it is the Microsoft.SqlServer.Management.Smo.Server class. It is only when I go to compile it that I get the issues.

    Also, I just tried re-adding the references (by browsing to the files). This has not changed anything. The version in vs2010 still says 10.0.0.0, even though the version on the files are 10.50.1750.9.

    • Edited by fweeee Monday, May 6, 2013 11:38 AM
    Monday, May 6, 2013 11:28 AM
  • I've managed to sort it out. This posting kind of answered it for me:
    http://social.msdn.microsoft.com/Forums/en-US/sqlsmoanddmo/thread/cc7a0cf0-8ddd-455b-9075-2a92f2716a05

    I needed to install the SQL Server 2005 Feature pack, and use those dll's.

    It all seems kind of odd. When using VS2008, I could use the SQL Server 2008 feature pack just fine. After upgrading to VS2010, I needed to downgrade my SQL Feature pack to 2005.
    • Marked as answer by fweeee Tuesday, May 7, 2013 11:44 AM
    Tuesday, May 7, 2013 11:44 AM
  • Thanks for sharing your solution.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, May 7, 2013 12:07 PM
    Moderator