Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Microsoft.SqlServer.Types, Version=11.0.0.0 missing

I have published the project on Azure websites and it throws exception:

Microsoft.SqlServer.Types, Version=11.0.0.0 missing when I try to run report. Locally everything works fine. I have RepowrtViewer.WebForms and ReportViewer.Common both version 11.0.0.0 in the project. On the machine locally in SDK/Assemblies

I have Microsoft.SqlServer.Types, Version=11.0..2100.6. I have tried to add this to the project but did not work. The same exception,

Where do I find Microsoft.SqlServer.Types 11.0.0.0?

Thank you

like image 463
Jacob_Zac Avatar asked May 16 '13 08:05

Jacob_Zac


3 Answers

You're probably referencing the DLL's from the global assembly cache on your local machine but they aren't present in the GAC in Azure.

Open up visual studio and right click on the Microsoft.SqlServer.Types assembly reference in your project and select properties. Change the copy local flag from False to True and recompile your application. You should now have the the Microsoft.SqlServer.Types.dll file in your applications bin folder.

Redeploy to azure and hopefully the error will have vanished.

like image 139
AndyM Avatar answered Oct 16 '22 15:10

AndyM


How I got this solved.

I had to add 5 files altogether and I moved these 5 files to my bin directory. I then added these references by browsing to the bin directory and adding them. I rebuilt my project and copied to web server - all working fine.

  1. Microsoft.SqlServer.Types.dll (make sure you copy the correct version as I had sql 2008 but using report viewer 11)
  2. Microsoft.ReportViewer.ProcessingObjectModel.dll
  3. Microsoft.ReportViewer.Common.dll
  4. Microsoft.ReportViewer.WebForms.dll
  5. Microsoft.ReportViewer.WinForms.dll

Also make sure you have the correct version of these dll's from the GAC in the bin directory and I installed report viewer on the server. These are the steps that worked for me.

like image 23
tfa Avatar answered Oct 16 '22 14:10

tfa


The best solution would be to install the Microsoft.SqlServer.Types NuGet package.

PM> Install-Package Microsoft.SqlServer.Types

And follow instructions from its readme.htm

like image 44
Ben Novoselsky Avatar answered Oct 16 '22 15:10

Ben Novoselsky