[英]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.