Can't add user controls in forms designer anymore

G

Guest

All of a sudden (after a reinstall) my Visual Studio .NET (2002) no longer allows me to add user controls to a C# form.

What happens is that if I create a new control, everything looks fine up until the point where I try to drag it from the toolbox into the parent form. Then VS all of a sudden can't seem to find the control. I get the following error message

"The user control '<control name>' could not be loaded. Ensure that the library containing the control has been built and a project reference has been made to the library containing 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.

This makes me a bit confused, especially since the control is present in the same library as the window to which it is to be added, and the build was successful. (I have tested with a separate library, but that didn't work either.

Adding the same control programmatically to the form works fine, as does adding it manually to the forms designer generated code. What I can't seem to get to work anymore is the dragging of the control from the toolbar to the form

Upgrading to VS.NET 2003 is not an option as the output has to be Framework 1.0, not 1.1

Does this bizarre problem sound familiar to anyone

//ecg
 
N

Niki Estner

I don't know your problem, but I can tell you that VS.NET 2003 CAN produce
perfect 1.0-Framework executables.
So it may be an option.

Niki

Erik Cedergren (ecgn) said:
All of a sudden (after a reinstall) my Visual Studio .NET (2002) no longer
allows me to add user controls to a C# form.
What happens is that if I create a new control, everything looks fine up
until the point where I try to drag it from the toolbox into the parent
form. Then VS all of a sudden can't seem to find the control. I get the
following error message:
"The user control '<control name>' could not be loaded. Ensure that the
library containing the control has been built and a project reference has
been made to the library containing 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."
This makes me a bit confused, especially since the control is present in
the same library as the window to which it is to be added, and the build was
successful. (I have tested with a separate library, but that didn't work
either.)
Adding the same control programmatically to the form works fine, as does
adding it manually to the forms designer generated code. What I can't seem
to get to work anymore is the dragging of the control from the toolbar to
the form.
 
G

Guest

The simple solution was that for some strange reason, VS.NET does not allow # characters in the source file paths, which is somewhat strange considering the name of the C# programming language. This is evidently a known bug, and is amended by changing the source directory path name.

//ecgn
 

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