[英]Could not load file or assembly '' or one of its dependencies
有什么幫助嗎?
我只有一個圖書館,這讓我發瘋。 這是我收到的錯誤。 我沒有使用任何其他依賴。
Could not load file or assembly 'FOD.Intranet.Lib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=039c1f3a4c719e82' or one of its dependencies. The system cannot find the file specified.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'FOD.Intranet.Lib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=039c1f3a4c719e82' or one of its dependencies. The system cannot find the file specified.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[FileNotFoundException: Could not load file or assembly 'FOD.Intranet.Lib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=039c1f3a4c719e82' or one of its dependencies. The system cannot find the file specified.]
NewCollection.VisualWebPart1.VisualWebPart1UserControl.TodaysNews() +0
NewCollection.VisualWebPart1.VisualWebPart1UserControl.Page_Load(Object sender, EventArgs e) +52
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42
System.Web.UI.Control.OnLoad(EventArgs e) +132
System.Web.UI.Control.LoadRecursive() +66
System.Web.UI.Control.AddedControl(Control control, Int32 index) +350
NewCollection.VisualWebPart1.VisualWebPart1.CreateChildControls() +155
System.Web.UI.Control.EnsureChildControls() +146
System.Web.UI.Control.PreRenderRecursiveInternal() +61
System.Web.UI.Control.PreRenderRecursiveInternal() +224
System.Web.UI.Control.PreRenderRecursiveInternal() +224
System.Web.UI.Control.PreRenderRecursiveInternal() +224
System.Web.UI.Control.PreRenderRecursiveInternal() +224
System.Web.UI.Control.PreRenderRecursiveInternal() +224
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3394
要使Visual Studio從解決方案中的其他項目向GAC添加第三方程序集甚至您自己的程序集,請執行下一步:
從SharePoint項目中的Package文件夾中打開Package.package。
單擊底部區域中的“高級”
單擊“添加”,然后選擇要添加的程序集類型。
在對話框中選擇dll文件,chec GAC或BIN,如果需要,添加安全控件和類資源條目。 單擊確定。
您的程序集將打包到WSP,在清單中定義並每次部署。
問題解決了!
我認為Visual Studio正在將DLL復制到GAC中,但顯然不是。 所以我手動復制它,它的工作原理。
但有一個問題是,在部署sharepoint應用程序時,Visual Studio不會將其復制到GAC這是正常的嗎?
對於那些想知道如何將dll復制到GAC的人
有兩種方法可以將dll復制到GAC:
手動復制DLL
使用VS將其部署到GAC。
感謝您的支持。
如果在Visual Studio 2012中發布時出錯,請在發布向導中取消選中“發布期間預編譯”選項,然后重試。
對於仍然在研究這個問題的人來說,你需要知道的是有一些不同的GACutils,所以你需要確保你使用正確的GACUTIL部署DLL來糾正GAC
例如:如果我的dll符合3.5 .net框架,我的操作系統版本是64位窗口,它將在下面的位置
C:\\ Program Files(x86)\\ Microsoft SDKs \\ Windows \\ v7.0A \\ Bin \\ x64
苦苦掙扎了4個愚蠢的日子來解決這個問題
請嘗試取消引用DLL然后再次引用它並重建項目。 還要檢查以確保版本與項目Web配置中的版本匹配
假設您有權訪問SharePoint服務器,請嘗試以下操作。 一些隨機的想法,沒有具體的順序。
您是否正在使用visual studio開發SharePoint項目(您的意思是Web部件嗎?)? 您是否在SharePoint項目中引用它? 您需要向我們提供有關開發環境的更多詳細信息,以便能夠查明問題。
如果您使用的是代碼Page.Load(“control_path ...”)。 確保您加載的實際ascx文件沒有包含異常消息中的程序集的任何指令
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.