6

After running an ASP.NET C# application with SQL SERVER version 2012, I get the following error message:

An error occurred during local report processing. The definition of the report 'C:\inetpub\wwwroot\psla\Reports\PD Listing Report - Per ED.rdlc' is invalid. An unexpected error occurred in Report Processing. Could not load file or assembly 'Microsoft.SqlServer.Types, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

What could be the cause? I have tried searching the net and there are references to version=11.0.0.0 but there are no references to version=12.0.0.0 for 'Microsoft.SqlServer.Types'. Reviewing the reference Manager for visual studio 2015, I was only able to find up to version=11.0.0.0.

Michael Petch
  • 46,082
  • 8
  • 107
  • 198
tksisawesome
  • 67
  • 1
  • 1
  • 6
  • ALTER DATABASE SET TRUSTWORTHY ON? Check up this. – Igor Micev Jul 09 '16 at 10:19
  • Any use? http://stackoverflow.com/questions/16906686/could-not-load-file-or-assembly-microsoft-sqlserver-management-sdk-sfc-version-1 12.x.x.x is SQL 2014, 11.x.x.x. is 2012 http://sqlserverbuilds.blogspot.com.au/ – Liesel Jul 09 '16 at 10:57

2 Answers2

3

In your Package Manager download the 12 version from Nuget

https://www.nuget.org/packages/Microsoft.SqlServer.Types/

Also see that entry for this is backward compatible in web.config

In your references folder right click and set copy local = true

rmehra76
  • 404
  • 2
  • 10
0

It appears that some library in your project is referencing Microsoft.SqlServer.Types, Version=12.0.0.0 but .NET runtime cannot find it at execution.

On the web server, where the application is running, make sure that there exists a following directory: C:\Windows\assembly\GAC_MSIL\Microsoft.SqlServer.Types\12.0.0.0__89845dcd8080cc91\

Also make sure that this directory has the file Microsoft.SqlServer.Types.dll of version 12 (12.0.2000.8). Different versions of the file can be downloaded from https://www.nuget.org/packages/Microsoft.SqlServer.Types/

myroslav
  • 1,670
  • 1
  • 19
  • 40