Getting access to full smo namespace in visual studio RRS feed

  • Question

  • I'm not sure if this is the right forum for this. If it isnt, can someone point me in the right direction?

    I have a C# winforms application that is using a some of the smo namespace functions (Microsoft.SqlServer.Management.Smo) to do database backups, restores, and other checks, etc.

    Recent computer problems have forced me to re-install SQL Server 2008 R2, and since then the code involving this namespace doesnt compile. It seems it cant recognise many of the classes within this namespace now (like Server, LoginCollection, UserCollection, etc).

    Now the dll's are there (I have installed the SQL SDK). If I remove one of the references, and put it back in (like Microsoft.SqlServer.SqlEnum), it seems to work - Visual studio recognises the classes, and can give me information about them. But as soon as I try to compile, it starts to not recognise them again.

    What do I need to do so visual studio can recognise them?

    I have already ran regasm over SqlWmiManagement.dll,  Smo.dll, SmoExtended.dll.

    Tuesday, November 18, 2014 10:22 AM


  • Never mind. I worked it out.

    The dll's I was referencing are .net 3.5, while my solution is .net 2. Not sure how this happened.

    Grabbed some older versions of the dll's, and its working much better now.

    • Marked as answer by fweeee Tuesday, November 18, 2014 10:42 AM
    Tuesday, November 18, 2014 10:42 AM