Could not load file or assembly 'Microsoft.SqlServer.Types
I have web application which we deployed in a production . We have separate servers for WEB and Database. The DB is SQL Server 2008 and it is hosted on a completely different server and we have our IIS installed on a different server.
On my web server, we get following error. Could not load file or assembly 'Microsoft.SqlServer.Types, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies
I checked the GAC on the web server and it was missing this particular开发者_如何学JAVA DLL. This makes sense to me since it is a web server and it is not supposed to have assemblies related to SQLServer.
Our application worked great in our dev, test and staging environment as our IIS and DB were installed on same server.
How do I get past this issue on Production? I can, by installing SQL Server 2008 on the web server. But this is does not make sense to me. It is a web server - why should I install SQL Server 2008 on that machine?
Microsoft SQL Server 2008 Feature Pack
Brief Description:
Download the Microsoft SQL Server 2008 Feature Pack, a collection of stand-alone install packages that provide additional value for SQL Server 2008. Specifically the CLR Data Types.
Note: Updated feature pack link Jan 2013
report viewer need this class
Microsoft.ReportViewer.Common.dll
Microsoft.ReportViewer.ProcessingObjectModel.dll
Microsoft.ReportViewer.WebForms.dll
Microsoft.ReportViewer.WinForms.dll
Microsoft.ReportViewer.DataVisualization.dll
Microsoft.SqlServer.Types.dll
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
As @Dave Swersky Said Require Microsoft SQL Server 2008 Feature Pack
But link has been changed to:
Microsoft® System CLR Types for SQL Server® 2008 R2:
X86 Package(SQLSysClrTypes.msi): http://go.microsoft.com/fwlink/?LinkID=188391&clcid=0x409 X64 Package (SQLSysClrTypes.msi): http://go.microsoft.com/fwlink/?LinkID=188392&clcid=0x409
Use original link will get a text file saying that package has been separate
I was able to ignore this error by simply pressing the "Continue" button when the error appeared. It didn't appear to effect operation of the 2008 R2 server once the install finished. I'm running Windows 7 64 bit.
Please see this forum post: https://social.technet.microsoft.com/Forums/sharepoint/en-US/7e673dde-dfca-4b1a-a840-025a2ae9ee58/reportviewer-msi-is-missing-microsoftsqlservertypesdll?forum=sqlreportingservices,
the first response. You can actually download the redistributable report viewer runtime .dlls and add the to your project so that they are deployed to machines that don't have those files.
And the link to actually downloading the runtime for VS 2012: http://www.microsoft.com/EN-US/download/confirmation.aspx?id=35747
PS you can also download them via NuGet (which is what I did.) Just search for "MICROSOFT® REPORT VIEWER 2012 RUNTIME " and they should come up - easiest way so far
For me Close the application and reopen it solve the problem
精彩评论