无法加载文件或程序集'Microsoft.SqlServer.Types
我有我们在生产中部署的网络应用程序。 我们有单独的 WEB 和数据库服务器。数据库是 SQL Server 2008,它托管在完全不同的服务器上,我们的 IIS 安装在不同的服务器上。
在我的网络服务器上,我们收到以下错误。 无法加载文件或程序集“Microsoft.SqlServer.Types,Version=10.0.0.0,Culture=neutral,PublicKeyToken=89845dcd8080cc91”或其依赖项之一
我检查了Web服务器上的GAC,它缺少这个特定的DLL。这对我来说很有意义,因为它是一个 Web 服务器,并且不应该具有与 SQLServer 相关的程序集。
我们的应用程序在我们的开发、测试和登台环境中运行良好,因为我们的 IIS 和数据库安装在同一台服务器上。
如何解决生产中的这个问题?我可以通过在 Web 服务器上安装 SQL Server 2008 来实现。但这对我来说没有意义。它是一个 Web 服务器 - 为什么我应该在该计算机上安装 SQL Server 2008?
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 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
Microsoft SQL Server 2008 功能包
简要说明:
下载Microsoft SQL Server 2008 功能包,独立安装包的集合,为 SQL Server 2008 提供附加价值。特别是 CLR 数据类型。
注意:2013 年 1 月更新的功能包链接
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.SqlServer.Types NuGet 包。
并按照其 readme.htm 中的说明进行操作
The best solution would be to install the Microsoft.SqlServer.Types NuGet package.
And follow instructions from its readme.htm
正如 @Dave Swersky 所说,需要 Microsoft SQL Server 2008 功能包
,但链接已更改为:
Microsoft® System CLR Types for SQL Server® 2008 R2:
X86 Package(SQLSysClrTypes.msi): http://go.microsoft.com/fwlink/?LinkID=188391&clcid=0x409
X64 包 (SQLSysClrTypes.msi):http://go.microsoft.com/ fwlink/?LinkID=188392&clcid=0x409
使用原始链接将得到一个文本文件,说明该包已被分离
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
当错误出现时,我只需按“继续”按钮即可忽略此错误。安装完成后,它似乎不会影响 2008 R2 服务器的运行。我运行的是 Windows 7 64 位。
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.
请参阅此论坛帖子:https://social.technet.microsoft.com/Forums/sharepoint/en-US/7e673dde-dfca-4b1a-a840-025a2ae9ee58/reportviewer-msi-is-missing-microsoftsqlservertypesdll ?forum=sqlreportingservices,
第一个响应。实际上,您可以下载可再发行的报表查看器运行时 .dll 并将其添加到您的项目中,以便将它们部署到没有这些文件的计算机上。
以及实际下载 VS 2012 运行时的链接: http:// /www.microsoft.com/EN-US/download/confirmation.aspx?id=35747
PS,您还可以通过 NuGet 下载它们(这就是我所做的。)只需搜索“MICROSOFT® REPORT VIEWER 2012 RUNTIME” “他们应该出现 - 迄今为止最简单的方法
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