Wednesday, August 29, 2012

VS 2012 Error : Could not load file or assembly 'Microsoft.SqlServer.Management.Sdk.Sfc, Version=11.0.0.0

When I tried to create new Connection in Server Explorer in Visual Studio 2012, I ran into the following error.

Could not load file or assembly 'Microsoft.SqlServer.Management.Sdk.Sfc, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.




When clicked [Test Connection], it was succeeded but when OK button is clicked, I got the [assembly not found] error.

From the error message, we can see there is some missing component in VS 2012 installation.
The assembly in question - Microsoft.SqlServer.Manangement.Sdk.Sfc version 11 - is a component DLL for SMO assemblies (even though SFC was originally created for more ambitious SSMS extension), and it is included in SQL Server 2012 Shared Management Objects.

[SQL 2012 Shared Management Objects]  has dependency on [SQL System CLR types] component, so you have to install SQL Server System CLR Types first.

[SQL Server 2012 System CLR Types] can be found in the middle of SQL 2012 Feature Pack web page ( http://www.microsoft.com/en-us/download/details.aspx?id=29065 )



And SharedManagemmentObjects 2012 also can be found in the same SQL 2012 Feature Pack web page
Once both components are installed, I was able to create new Connection.

By the way, as a side note, if you already have SQL Server 2012 installed on the machine, they are supposed to be installed already.

15 comments:

  1. Thanks dude... you just saved me a day of struggle.

    ReplyDelete
  2. DAMN !!!!

    i've been fighting this bug for 2 days now... your post saved me...

    wonder why VS2012 doesnt include those files

    ReplyDelete
  3. Wonderful, worked perfectly. Thanks so much.

    ReplyDelete
  4. hi
    I use Windows 8 I am trying to connect VS 2012 Express with SQL SERVER 2008 R2.I am unable to connect.It shows the same error as mentioned above.

    I have downloaded SQL CLR Types and Shared management objects.Still I have the same error.Do I need to add them in references in VS???
    Could you pls explain clearly the steps after download???

    I am a fresher

    ReplyDelete
  5. Hi Charanya,
    If you already downloaded those 2 files, you can simply install it by doubleclicking the .msi file one by one from file explorer.
    Once you installed them, you should be able to see Microsoft.SqlServer.Management.Sdk.Sfc 11.0 when you navigate to C:\windows\assembly from your File Explorer.
    You do not have to add reference. This DLL is used by VS itself (precisely, by Server Explorer), not by your own project or solution.
    Hope it helps.

    ReplyDelete
  6. Hi Alex,
    I do have the same problem as Charanya and did the same thing but still the error is there. I checked in C:\windows\assembly\Microsoft.SqlServer.Management.Sdk.Sfc, Version 10.0.0.0 is shown instead of 11.0.0.0
    please suggest me I am also a fresher

    Thanx

    ReplyDelete
  7. Hi Deepty,
    SFC Version 10.0 is for SQL 2008 (or 2008 R2) SMO. In order to use VS 2012, you will need to install version 11.0, not v10.0.
    Once you install SQL 2012 Shared Management Objects, you will see both v11.0 and v10.0 on your machine. Bottom line is you should have v11.0 SFC on your machine.

    ReplyDelete
  8. Hi, I've already downloaded SQL CLR types and shared management objects. it still have the same problem.


    Could not load file or assembly 'Microsoft.SqlServer.Management.Sdk.Sfc, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.

    ReplyDelete
  9. Hi QRinaQ,
    1) Can you please check whether you have the DLL in C:\Windows\assembly\GAC_MSIL\Microsoft.SqlServer.Management.Sdk.Sfc\11.0.0.0__89845dcd8080cc91 folder?
    2) If it does exist, can you try fuslogvw.exe to see what the binging path looks like?
    3) You can also try Depeneds.exe (dependancy walker) to see if there is any missing (native) DLL on your machine.

    ReplyDelete
  10. Thanks a lot.Its working now.now i am relieved from stress...

    ReplyDelete
  11. The link provided have only a text file

    ReplyDelete
  12. This came in very handy.
    Got me out of a sticky situation.

    Thank you

    ReplyDelete
  13. hi alex can u help me i am shan
    this error cant solve in my system.

    ReplyDelete