Sharepoint “Could not load file or assembly” “The system cannot find the file specified”

瘦欲@ 提交于 2020-01-14 07:47:07

问题


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?


回答1:


You need to make sure that the sharpPDF dll is registered in the GAC.

Go to %Windows%\assembly. If sharpPDFisn't there with version 1.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.




回答2:


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.



来源:https://stackoverflow.com/questions/1265505/sharepoint-could-not-load-file-or-assembly-the-system-cannot-find-the-file-sp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!