views:

17317

answers:

4

Inside VS2005, our whole programming staff gets this error message sporadically and it is always on the BeneControls project. This error message happens multiple times a day and it occurs when going into DESIGN mode for a control. Normally rebuilding the BeneControls fixes the problem but somtime the whole solution has to be rebuilt.

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.

We are using Visual Studio 2005, VB.NET and DevExpress Controls.

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

+6  A: 

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?

On 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.

Otávio Décio
Thanks for your reply.How do you "fix on a version number"? What steps have to be done?
Gerhard Weiss
I edited my answer with the steps.
Otávio Décio
@Otávio Décio If I have to automatically set Build Number andRevision for deployment then what is the solution? I always have to change it manually if I change it to 1.0.0.0.
Muhammad Kashif Nadeem
A: 

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.

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)

Rowland Shaw
A: 

thanks for this answer

A: 

Hi, I am facing same problem. In my case, I am invoking one dll by making use of reflections. Invocation of that DLL works fine if I invoke it from same project. However, when I created another project and added previous project ( project containing DLL), and tried to use method of previous project to invoke DLL, I get error as "Could not load file or assembly". Anyone has idea about what is the problem?

Shekhar