Sharepoint“无法加载文件或程序集” “系统找不到指定的文件”
我已将 dll (sharpPDF) 的引用添加到我的 .net 项目中。 在代码中它已经获取了 dll,我可以使用它。 当我通过 sharepoint webpart 部署时,出现以下错误:
Could not load file or assembly 'sharpPDF, Version=1.0.3511.18105, Culture=neutral,
PublicKeyToken=f099e668beaaa0f9' or one of its dependencies. The system cannot find the
file specified.
我正在使用 STSDEV 部署 web 应用程序。 我尝试清除 C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files,但这并不能解决问题。
有什么想法可能会出问题吗?
I have added a reference to a dll (sharpPDF) to my .net project. In the code it has picked up the dll and I can use it. When I deploy by sharepoint webpart i get the following error:
Could not load file or assembly 'sharpPDF, Version=1.0.3511.18105, Culture=neutral,
PublicKeyToken=f099e668beaaa0f9' or one of its dependencies. The system cannot find the
file specified.
I am deploying the webapp by using STSDEV. I have tried clearing out C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files but this does not solve the problem.
Any ideas what could be going wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要确保
sharpPDF
dll 已在 GAC 中注册。转到
%Windows%\ assembly
。 如果1.0.3511.18105
版本中没有sharpPDF
,您需要将其安装到服务器上的 GAC 中。 只需将其拖到 Windows 资源管理器中的该文件夹中,它就会自行安装。You need to make sure that the
sharpPDF
dll is registered in the GAC.Go to
%Windows%\assembly
. IfsharpPDF
isn't there with version1.0.3511.18105
, you need to install it to the GAC on the server. Simply drag it into that folder in Windows Explorer, and it should install itself.我曾经多次收到此错误,您在项目引用中引用的库与 GAC 中的库之间可能存在版本冲突。
尝试检查引用的 Copylocal 属性为“False”,并将库添加到项目包中。 确保所有地方都有相同版本的 dll。
这解决了我的问题。
I used to get this error many times, there might be version conflict between the library you were referring in project references and the library that was in GAC.
Try to check "False" for Copylocal property of the reference and also add the library to project package. make sure to have the same version of dll in all the places.
this solved my issue.