C# Tips

C# Tip Article

VS : Could not load file or assembly Microsoft.SqlServer.Management.Sdk.Sfc

Sometimes people asked some questions on one of my old blog - "VS 2012 Error : Could not load file or assembly 'Microsoft.SqlServer.Management.Sdk.Sfc, Version=11.0.0.0"
Since this blog is little old and it was about old version of VS (VS 2012), I guess it might be helpful to add little more information on that.

The problem was, we can get "Could not load file or assembly Microsoft.SqlServer.Management.Sdk.Sfc" error when trying to add New Connection (against SQL Server) in Server Explorer of Visual Studio.

A few questions from the old blog were, it did not work even if they followed the instruction on the blog. My understanding is, main reason for that is because they are using different versions of VS and/or SQL Server client.


In summary,

if you are getting the following error:
"Could not load file or assembly Microsoft.SqlServer.Management.Sdk.Sfc 11.0.0.0"

first check the version of the missing Microsoft.SqlServer.Management.Sdk.Sfc assembly at the end.
It can be 10.0, 11.0, 12.0, etc.

Depending on the missing SFC version, you need to install the following 2 MSI files

(1) SQLSysClrTypes.msi
(2) SharedManagementObjects.msi

from the corresponding version of SQL Server Feature Pack as below.

SFC versionFeature Pack to install
Microsoft.SqlServer.Management.Sdk.Sfc 10.0 SQL Server 2008 Feature Pack
Microsoft.SqlServer.Management.Sdk.Sfc 11.0SQL Server 2012 Feature Pack
Microsoft.SqlServer.Management.Sdk.Sfc 12.0SQL Server 2014 Feature Pack

When you visit the Feature Pack web page, click [Download] button, and then you will see file list as shown below. Scroll down and find SQLSysClrTypes.msi and SharedManagementObjects.msi.
The following picture shows 2 MSI files of SQL 2014 Feature Pack.

Once you have installed the missing files, you can verify by navigating to %WINDIR%\assembly (typically C:\Windows\assembly) in File Explorer. On my machine - as you see below - I happen to have 3 different versions of Microsoft.SqlServer.Management.Sdk.Sfc files.