vb.net 无法加载文件或程序集“xxxx”或其依赖项之一。该系统找不到指定的文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/408002/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Could not load file or assembly 'xxxx' or one of its dependencies. The system cannot find the file specified
提问by Gerhard Weiss
Inside VS2005, our whole programming staff gets this error message sporadicallyand it is always on the BeneControlsproject. This error message happens multiple times a day and it occurs when going into DESIGN mode for a control. Normally rebuilding the BeneControlsfixes the problem but somtime the whole solution has to be rebuilt.
在 VS2005 中,我们的整个编程人员偶尔会收到此错误消息,并且始终在BeneControls项目中。此错误消息每天发生多次,并且在进入控件的设计模式时会发生。通常重建BeneControls 可以解决问题,但有时必须重建整个解决方案。
Has anyone else solved this problem yet?
有没有其他人解决过这个问题?
Any recommendations or web sites that outlines what needs to be done?
任何建议或网站概述了需要做什么?
Sometimes I just wish MS would add a rebuild button to the error message screen.
有时我只是希望 MS 在错误消息屏幕上添加一个重建按钮。
We are using Visual Studio 2005, VB.NET and DevExpress Controls.
我们正在使用 Visual Studio 2005、VB.NET 和 DevExpress 控件。
Here is the whole error message:
这是整个错误消息:
One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed by rebuilding your project, while others may require code changes.
Could not load file or assembly 'BeneControls, Version=1.0.3289.23008, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
Hide
at System.Signature._GetSignature(SignatureStruct& signature, Void* pCorSig, Int32 cCorSig, IntPtr fieldHandle, IntPtr methodHandle, IntPtr declaringTypeHandle)
at System.Signature.GetSignature(SignatureStruct& signature, Void* pCorSig, Int32 cCorSig, RuntimeFieldHandle fieldHandle, RuntimeMethodHandle methodHandle, RuntimeTypeHandle declaringTypeHandle)
at System.Signature..ctor(RuntimeFieldHandle fieldHandle, RuntimeTypeHandle declaringTypeHandle)
at System.Reflection.RtFieldInfo.get_FieldType()
at System.ComponentModel.Design.InheritanceService.AddInheritedComponents(Type type, IComponent component, IContainer container)
at System.Windows.Forms.Design.DocumentDesigner.Initialize(IComponent component)
at System.ComponentModel.Design.DesignerHost.AddToContainerPostProcess(IComponent component, String name, IContainer containerToAddTo)
at System.ComponentModel.Design.DesignerHost.Add(IComponent component, String name)
at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.CreateComponent(Type componentType, String name)
at System.ComponentModel.Design.Serialization.DesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer)
at System.ComponentModel.Design.Serialization.DesignerSerializationManager.System.ComponentModel.Design.Serialization.IDesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer)
at System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, CodeTypeDeclaration declaration)
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
at System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost host)
Thanks in advance, Gerhard
提前致谢,格哈德
采纳答案by Otávio Décio
Version=1.0.3289.23008 - that tells me you version number is constantly changing, have you thought about fixing on a version number during development?
Version=1.0.3289.23008 - 这告诉我你的版本号在不断变化,你有没有想过在开发过程中修复一个版本号?
On AssemblyInfo.vb:
在 AssemblyInfo.vb 上:
Currently it is set to increment:
目前它被设置为递增:
[assembly: AssemblyVersion("1.0.*.*")]
Change to:
改成:
[assembly: AssemblyVersion("1.0.0.0")]
And you have it in a fixed version.
你有一个固定版本。
回答by azhar
Well, I am not a developer but I got to deploy a project which actually send fax using the fax services on windows 2008 server 64bit. the project was developed on a windows 32bit platform and I was setting all the information according to the given instruction but still I this annoying error and then I found the solution and that was to change the platform from anycpu to x86 and it worked. for a complete setting list please follow the link below: http://www.sizledcore.com/2011/10/could-not-load-file-or-assembly/
好吧,我不是开发人员,但我必须部署一个项目,该项目实际上使用 Windows 2008 服务器 64 位上的传真服务发送传真。该项目是在 windows 32 位平台上开发的,我根据给定的指令设置了所有信息,但仍然出现了这个烦人的错误,然后我找到了解决方案,那就是将平台从 anycpu 更改为 x86 并且它起作用了。如需完整的设置列表,请点击以下链接:http: //www.sizledcore.com/2011/10/could-not-load-file-or-assembly/
回答by Rowland Shaw
I've seen this in the past in a situation where the control was in the same assembly as the consumer - the GAC and versioning didn't help there -- it seems to be related to the way that the designer locks the assembly in memory, and refuses to budge.
我过去曾在控件与使用者在同一个程序集中的情况下看到过这种情况——GAC 和版本控制在那里没有帮助——这似乎与设计者将程序集锁定在内存中的方式有关,并拒绝让步。
The advice our developers have is to not leave form designers open when closing VS, or switching between build types (I think it's due to the sharing the same output folder between build configurations in VB.Net)
我们的开发人员的建议是在关闭 VS 或在构建类型之间切换时不要让表单设计器保持打开状态(我认为这是由于在 VB.Net 中的构建配置之间共享相同的输出文件夹)