inherited user control

M

Mihai

Hi !

I use VB.Net 2005.
I created an inherited user control based on a previosly created user
control.Everything is Ok . I can run this control with f5, everything is
fine. When I close Visual Studio and a open it again and load my project I
have the error:

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.

Unable to load one or more of the requested types. Retrieve the
LoaderExceptions property for more information.
Hide

at System.Reflection.Module.GetTypesInternal(StackCrawlMark&
stackMark)
at System.Reflection.Assembly.GetTypes()
at
Microsoft.VisualStudio.Shell.Design.AssemblyObsoleteEventArgs..ctor(Assembly
assembly)
at
Microsoft.VisualStudio.Design.VSDynamicTypeService.ReloadAssemblyIfChanged(S
tring codeBase)
at
Microsoft.VisualStudio.Design.VSDynamicTypeService.CreateDynamicAssembly(Str
ing codeBase)
at
Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.get_Asse
mbly()
at
Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.Search(S
tring fullName, String typeName, Boolean ignoreTypeCase, Assembly& assembly,
String description)
at
Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchProjectEntries(A
ssemblyName assemblyName, String typeName, Boolean ignoreTypeCase, Assembly&
assembly)
at
Microsoft.VisualStudio.Design.VSTypeResolutionService.GetType(String
typeName, Boolean throwOnError, Boolean ignoreCase, ReferenceType refType)
at
Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionS
ervice.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
at
Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionS
ervice.GetType(String name)
at
System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesi
gnerHost.GetType(String typeName)
at
System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.EnsureDocum
ent(IDesignerSerializationManager manager)
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(IDe
signerLoaderHost host)



I rebuid the project but no effect and I cannot load this inherited user
control. I cannot even see it .
Any ideas please why is happening ?

Thank you
 
T

Tom Shelton

Hi !

I use VB.Net 2005.
I created an inherited user control based on a previosly created user
control.Everything is Ok . I can run this control with f5, everything is
fine. When I close Visual Studio and a open it again and load my project I
have the error:

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.

Unable to load one or more of the requested types. Retrieve the
LoaderExceptions property for more information.
Hide

at System.Reflection.Module.GetTypesInternal(StackCrawlMark&
stackMark)
at System.Reflection.Assembly.GetTypes()
at
Microsoft.VisualStudio.Shell.Design.AssemblyObsoleteEventArgs..ctor(Assembly
assembly)
at
Microsoft.VisualStudio.Design.VSDynamicTypeService.ReloadAssemblyIfChanged(S
tring codeBase)
at
Microsoft.VisualStudio.Design.VSDynamicTypeService.CreateDynamicAssembly(Str
ing codeBase)
at
Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.get_Asse
mbly()
at
Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.Search(S
tring fullName, String typeName, Boolean ignoreTypeCase, Assembly& assembly,
String description)
at
Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchProjectEntries(A
ssemblyName assemblyName, String typeName, Boolean ignoreTypeCase, Assembly&
assembly)
at
Microsoft.VisualStudio.Design.VSTypeResolutionService.GetType(String
typeName, Boolean throwOnError, Boolean ignoreCase, ReferenceType refType)
at
Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionS
ervice.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
at
Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionS
ervice.GetType(String name)
at
System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesi
gnerHost.GetType(String typeName)
at
System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.EnsureDocum
ent(IDesignerSerializationManager manager)
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(IDe
signerLoaderHost host)



I rebuid the project but no effect and I cannot load this inherited user
control. I cannot even see it .
Any ideas please why is happening ?

Are you performing any operations in the load event? Especially, things that
might error, like db access? If you are, are they surounded with code that
looks like:

If Not Me.DesignMode Then
' Do Cool Stuff
End If

?
 
M

Mihai

Yes , indeed I have in the Load event of the control some code that get
something from a Sql server table. I will try what you said
Thank you !
 
M

Mihai

Hi Again Tom !

I found in MSDN something interesting about this stuff.Have a look at
"Troubleshooting Inherited Event Handlers in Visual Basic 2005 " .Is work
how they said . Anyway I will put in code the both methods !

Regards,
Mihai
 
M

Mihai

Now I have this error for the same scenario :

Could not load file or assembly 'BaseControls, Version=1.0.2560.40871,
Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system
cannot find the file specified.":"BaseControls, Version=1.0.2560.40871,
Culture=neutral, PublicKeyToken=null"}

This project BaseControls is in the same assemblies as with the others !

Why Visual Studio cannot find this file ?

Any ideas ?

Mihai

Hi Again Tom !

I found in MSDN something interesting about this stuff.Have a look at
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top