In this article I will explain with an example, how to resolve the following error.
Could not load file or assembly 'Microsoft.SqlServer.Types, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies.
Problem
The Microsoft.SqlServer.Types.dll version 11 is required for running RDLC Reports and it is not distributed with newer versions of SQL Server.
Hence in order to use RDLC Report, you will need to install the reference of this DLL.
Solutions
Following are the solutions to this problem:
1. Install
Microsoft.SqlServer.Types package from
Nuget.
2. Download the SQLSysClrTypes version 11.0 Installer File for Microsoft.SqlServer.Types DLL.
Installing Microsoft.SqlServer.Types Version 11 Library
You will need to install the Microsoft.SqlServer.Types package using the following command.
Install-Package Microsoft.SqlServer.Types -Version 11.0.0
After successful installation, open Solution Explorer and then expand the References folder and look for Microsoft.SqlServer.Types reference.
Now, right click on it and click Properties. And in the Properties window, make sure that the Copy Local property is set to TRUE as shown below.
Downloading SQLSysClrTypes version 11.0 Installer file
You will need to download the SQLSysClrTypes version 11.0 Installer file from the following link.
Once you visit the page, you need to follow the following steps.
1. First, you need to select language to English and then click on Download button.
2. Once you click the Download button, it will open a Popup where look for SQLSysClrTypes.msi and select its CheckBox, and then click on the Download button.
3. Once the file is downloaded, you need to Right click on it and click Install.
4. Now in the Microsoft System CLR Types for SQL Server 2012 Setup window, click on the Next button.
5. Then accept the Agreement and click Next button.
6. Finally, click on the Install button to proceed the installation process.
7. After setup has successfully installed, click Finish button to exit.
After installation, restart your PC and once restarted navigate to the following location and there you will see the installed DLL.