views:

28

answers:

2

Why I get the following error in the Visual Studio (2010) designer if a try to load the Form1 that hosts my custom control at design-time?

Could not find type 'myCustomControl'. Please make sure that the assembly that contains this type is referenced. If this type is a part of your development project, make sure that the project has been successfully built using settings for your current platform or Any CPU.
The variable 'myCustomControl1' is either undeclared or was never assigned.

It happens only when I add the reference to the .NET wrapper DLL (without referencing the .NET wrapper DLL the Visual Studio designer loads correctly). The windows form application works fine at run-time copying all the necessary wrapper's DLLs to side by side to application main assembly.

I suspect that the additional .NET wrapper DLLs are not copied when the custom control is used at design time. Is it possible?

Thanks.

A: 

The main problem could be that you're handling something if the Custom Control is in DesignMode. Please provide the Load code of your Custom Control to get further help.

Timur Zanagar
A: 

The problem was a C# template function containing a parameter of one of the types declared into the .NET wrapper DLL.

devdept