即使使用“复制本地",也无法加载文件或程序集"Microsoft.SqlServer.Types" [英] Could not load file or assembly 'Microsoft.SqlServer.Types even with Copy Local
问题描述
我在Web应用程序上有一个内部报告,当我浏览到本地报告时,它会按预期显示.我正在使用 rdlc
和 xsd
和标准的 apsx
网页来呈现报告.
I have an internal report on my web application which when I browse to it locally displays as expected. I am using a rdlc
and xsd
with a standard apsx
web page to render the report.
我现在已经部署到我的登台服务器上,当我尝试浏览到显示报告的页面时:
I have now deployed to my staging server and when I try to browse to the page which displays the report I am getting:
An unexpected error occurred in Report Processing.
Could not load file or assembly 'Microsoft.SqlServer.Types, Version=11.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)
在本地,我通过浏览到以下地址添加了对 Microsoft.SqlServer.Types
的引用:
Locally, I have added a Reference to Microsoft.SqlServer.Types
by browsing to:
C:\ Windows \ assembly \ GAC_MSIL \ Microsoft.SqlServer.Types \ 11.0.0.0__89845dcd8080cc91
C:\Windows\assembly\GAC_MSIL\Microsoft.SqlServer.Types\11.0.0.0__89845dcd8080cc91
并且我将其设置为 Copy Local
,并且可以在登台服务器上的bin文件夹中看到 .dll
,但是我仍然收到错误消息.
And I have set it to Copy Local
and can see the .dll
in the bin folder on the staging server, however I'm still getting the error message.
出于兴趣,我从本地计算机复制了 .dll
,并通过ftp将其ftp到登台服务器和bin文件夹中.然后它开始工作,直到我再次提交,这又擦掉了bin文件夹并返回了错误.
Out of interest I copied the .dll
from my local machine, and ftp'd it to the staging server and into the bin folder. It then worked, temporarily until I did another commit, which wiped the bin folder and the error returned.
好像是 Microsoft.SqlServer.Types
的版本在登台服务器的OS上已经过时了?
Its like the version of Microsoft.SqlServer.Types
is out of date on the staging server's OS perhaps?
这是怎么回事?
推荐答案
如果您确定dll在bin文件夹中,则可能正在寻找依赖项之一
.
It's probably looking for one of its dependencies
if you're sure the dll is in the bin folder.
您是否尝试过删除引用并添加以下NuGet软件包,而不是从GAC引用?
Instead of referencing from the GAC have you tried removing the reference and adding the following NuGet package ?
https://www.nuget.org/packages/Microsoft.SqlServer.类型/
这篇关于即使使用“复制本地",也无法加载文件或程序集"Microsoft.SqlServer.Types"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!