为什么在运行时找不到我的项目的 DLL referenced/used?
Why is a DLL referenced/used by my project not found at runtime?
我已将几个 iTextSharp DLL 添加到 Sharepoint 2010 项目(作为 WebPart 部署)。
Web 部件 compiles/runs 很好(我可以在与 Sharepoint 站点页面上的 Web 部件交互的同时单步执行我的 WebPart 项目)。也就是说,它运行良好,直到调用实际使用 itextsharp.dll 的代码。然后,页面崩溃,我得到(在日志文件中),"The system cannot find the file specified"
是否必须将 DLL 部署到特定位置以便 Sharepoint 找到它们,或者...???
更新
即使将四个 itextsharp DLL 复制到 C:\Windows\Microsoft.NET(Windows Server 2008、.NET 3.5),我仍然收到相同的错误消息。
有关日志文件中的详细信息:
03/30/2015 14:49:28.43 w3wp.exe (0x0968) 0x1834 SharePoint Foundation Runtime tkau Unexpected System.IO.FileNotFoundException: Could not load file or assembly 'itextsharp, Version=5.5.5.0, Culture=neutral, PublicKeyToken=6574839201' or one of its dependencies. The system cannot find the file specified. at XMLToPDF.XMLToPDFWebPart.XMLToPDFWebPart.ConvertFromXMLToPDF(List`1 listOfListItems) at XMLToPDF.XMLToPDFWebPart.XMLToPDFWebPart.btnSave_Click(Object sender, EventArgs e) at System.Web.UI.WebControls.Button.OnClick(EventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) ef8cece3-42f4-47d0-ab0a-ca2f0fff46e4
link provided by user2864740 是关键。
简而言之,这就是我所做的:
2-clicked Package.package
Selected the "Advanced" button
Selected the "Add" > "Add Existing Assembly" button
Verified "GlobalAssemblyCache" was selected
Using the ellipsis button affiliated with the "Source Path" edit, added each needed DLL one at a time
Saved Package.package
而且:瞧! Mudville 的欢乐时光,包括自动收报机游行、一支拥有 76 个长号的行进乐队,以及整整九码(IOW,成功了)。
我已将几个 iTextSharp DLL 添加到 Sharepoint 2010 项目(作为 WebPart 部署)。
Web 部件 compiles/runs 很好(我可以在与 Sharepoint 站点页面上的 Web 部件交互的同时单步执行我的 WebPart 项目)。也就是说,它运行良好,直到调用实际使用 itextsharp.dll 的代码。然后,页面崩溃,我得到(在日志文件中),"The system cannot find the file specified"
是否必须将 DLL 部署到特定位置以便 Sharepoint 找到它们,或者...???
更新
即使将四个 itextsharp DLL 复制到 C:\Windows\Microsoft.NET(Windows Server 2008、.NET 3.5),我仍然收到相同的错误消息。
有关日志文件中的详细信息:
03/30/2015 14:49:28.43 w3wp.exe (0x0968) 0x1834 SharePoint Foundation Runtime tkau Unexpected System.IO.FileNotFoundException: Could not load file or assembly 'itextsharp, Version=5.5.5.0, Culture=neutral, PublicKeyToken=6574839201' or one of its dependencies. The system cannot find the file specified. at XMLToPDF.XMLToPDFWebPart.XMLToPDFWebPart.ConvertFromXMLToPDF(List`1 listOfListItems) at XMLToPDF.XMLToPDFWebPart.XMLToPDFWebPart.btnSave_Click(Object sender, EventArgs e) at System.Web.UI.WebControls.Button.OnClick(EventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) ef8cece3-42f4-47d0-ab0a-ca2f0fff46e4
link provided by user2864740 是关键。
简而言之,这就是我所做的:
2-clicked Package.package
Selected the "Advanced" button
Selected the "Add" > "Add Existing Assembly" button
Verified "GlobalAssemblyCache" was selected
Using the ellipsis button affiliated with the "Source Path" edit, added each needed DLL one at a time
Saved Package.package
而且:瞧! Mudville 的欢乐时光,包括自动收报机游行、一支拥有 76 个长号的行进乐队,以及整整九码(IOW,成功了)。