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.

NOTE: This article only talked about VS 2012 and SQL 2012. More people ran into the same issue for other VS / SQL versions. I wrote an additional article for other versions of VS and SQL. Please refer to this article if this article instruction does not work for you.

43 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
  14. thanks a lot, it solved the issue

    ReplyDelete
  15. Hi,

    I am able to see Microsoft.SqlServer.Management.Sdk.Sfc 12.0 and 10.0 not the 11.0.

    I am having SQL Server 2014 and MS Visual Studio 2013 on Windows 7 system.

    When I am trying to install Windows installer 4.5 it's not getting installed.

    ReplyDelete
  16. This solved the issue thanks a lot!!! Working on SQL Server 2014 and Visual Studio 2013 under Windows 8.1

    ReplyDelete
  17. This comment has been removed by the author.

    ReplyDelete
  18. This comment has been removed by the author.

    ReplyDelete
  19. I am using VS 2013 and sql server 2008
    I got the same error and and i have installed this three
    Microsoft SQL Server System CLR Types
    Microsoft SQL Server 2008 Management Object
    Microsoft SQL Server 2008 Native Client
    and also i am getting the same error.... please help me I am struggling a lot with this,....

    ReplyDelete
  20. @Venugopal : What exactly is the error saying? (SFC version can vary)

    ReplyDelete
  21. thanks man u saved my a lot time
    iam serching for this from one week
    thanks lot
    keep growing

    ReplyDelete
  22. This comment has been removed by the author.

    ReplyDelete
  23. I am using VS2013 with Sql Server 2005
    I am getting with the follwing 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.


    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 help me. I lost my whole day in finding this.

    ReplyDelete
  24. Yahhhhhhhh !!!!

    i have been fighting this bug for last 4 days now... your info is very useful..............
    thanks lot.....................................
    .....................

    ReplyDelete
  25. Hi i am using windows 7 and i hahe installed sql server 2008 and visual studio 2013 when i connect to database by using tools and test connection it is fine but then press ok give this error (Unable to add data connection. 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.) please help me.
    thanks
    mintu

    ReplyDelete
  26. and also i am getting the same error.... please help me I am struggling a lot with this,....

    ReplyDelete
  27. Nitesh, did you install below components?
    1) SQL Server 2012 System CLR Types
    2) SQL 2012 Shared Management Objects

    ReplyDelete
    Replies
    1. No sir,
      I did nat install
      1) SQL Server 2012 System CLR Types
      2) SQL 2012 Shared Management Objects

      Delete
    2. Sir,
      but my sql server is 2008 and my visual studio is 2013

      Delete
    3. i am fighting this bug for last 4 days now.please help me.

      Delete
    4. How to install?
      1) SQL Server 2012 System CLR Types
      2) SQL 2012 Shared Management Objects

      Delete
    5. 1) Click http://www.microsoft.com/en-us/download/details.aspx?id=29065
      2) Click Download. You will download [SQL Server 2012 Feature Pack Instructions.txt] file
      3) Read the instruction file and follow the instruction.

      You will need to install these:
      - Microsoft® System CLR Types for Microsoft® SQL Server® 2012
      - Microsoft® SQL Server® 2012 Shared Management Objects

      Delete
    6. This comment has been removed by the author.

      Delete
  28. This comment has been removed by the author.

    ReplyDelete
  29. I have installed visual studio 2015 and sql server 2012. I have also installed
    - Microsoft® System CLR Types for Microsoft® SQL Server® 2012
    - Microsoft® SQL Server® 2012 Shared Management Objects

    I stil found following error while adding a data connection in visual studio 2015:

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

    ReplyDelete
    Replies
    1. Your SFC version is for SQL 2014. You need SQL 2014 feature pack instead of SQL 2012 one. Please see this article for details.

      http://csharp.tips/tip/article/958-VS---Could-not-load-file-or-assembly-Microsoft-SqlServer-Management-Sdk-Sfc

      Delete
  30. could not load file or ssembly
    microsoft.sqlserver.management.sdk.sfc, version=12.0.0.0, culture = neutral, publickey token=89845dcd8080cc91 or one of its dependencies. the system cannot find the file specified.

    I have this message when I try to link to the database
    what should I do?
    Can you help me please please please....

    ReplyDelete
    Replies
    1. You will need to install SQL Server 2014 Feature Pack. Please refer to this article.

      http://csharp.tips/tip/article/958-VS---Could-not-load-file-or-assembly-Microsoft-SqlServer-Management-Sdk-Sfc

      Delete
    2. ok. i'll try.
      thanks alot for u

      Delete
  31. version=12.0.0.0, culture = neutral, publickey token=89845dcd8080cc91 or one of its dependencies. the system cannot find the file specified.

    ReplyDelete
  32. لما اضغط okبيظهر رساله خطا

    ReplyDelete