User Controls disappear

  • Thread starter Thread starter Michael Polen
  • Start date Start date
M

Michael Polen

I create a user control (actually a several). Everything
is fine. I use it on a form or two. Everything is fine.
All of a sudden when I make a change and rebuild, it can't
find the control anymore. SAME PROBLEM OCCURS WITH C# OR
VB.NET???????

Error Message:
The user control ... could not be loaded. Ensure that the
library containing the control has been built and a
project reference has been made to the library containg
the control. If you have changed the name of the user
control, close and re-open the control's designer to
update the toolbox item

I didn't do anything that I can figure. The controls are
in the same namespace and project as the mainline.
 
Are your user controls in the same solution as the main project?

Is "Copy Local" set to true for the references?

Can you give more info about "All of a sudden when I make a change and
rebuild"... where is this change made - to the User control or the main
project?

- VJ
 
1. Yes, the controls are in the same solution.
2. What is "Copy Local?" How do I set it?
3. I can make a change to any of the controls or try to change the main
by just adding a control to it. All of a sudden some or all of my
controls no longer appear in the namespace.
 
Click on the reference to your user control in your main project, and see
the properties. You'll have a property named "Copy Local". Set it to true.
I'm not sure if this is the problem, but it's worth a try.

Also, do you have the output directory for both the projects set to the same
directory?

- VJ
 
Yes, there is only one directory involved.
I can't find a copy local property anywhere.


Mike Polen
4 year of programming experience spread over 4 decades -- who remembers
1401 autocoder?
 
Michael Polen said:
I create a user control (actually a several).
[...]
All of a sudden when I make a change and
rebuild, it can't find the control anymore.

When the controls and application are in the same solution, this can happen
if you rebuild the solution and part of the rebuild fails (e.g. a syntax
error). If this is the case, you just have to fix the problem and rebuild
before trying to open any of the forms in design view.

P.
 
Paul
That would make sense if I was getting any other errors. Buy the build
says successful with no errors. Sometimes I can't even add the control
to the main form. It acts like it does when you create a new control and
try to add it to the form without first building.

Mike
happen if you rebuild the solution and part of the rebuild fails (e.g. a
syntax error). If this is the case, you just have to fix the problem and
rebuild before trying to open any of the forms in design view.
<<<

MP
4 year of programming experience spread over 4 decades -- who remembers
1401 autocoder?
 
Back
Top