Article ID: 322730 - Last Review: February 17, 2006 - Revision: 3.3 BUG: "Could not be loaded" error occurs when you add a .NET UserControl control to a formThis article was previously published under Q322730 On This PageSYMPTOMS When you try to add an instance of a .NET UserControl control to a form, you may receive the following error message:
The user control
'WindowsControlLibrary1.UserControl1'
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. CAUSE This error may occur because of the reasons that are stated
in the error message. However, this error may also occur if the path to the
location from which the UserControl project was opened contains a number sign (#). For example, you
receive the error message that is listed in the "Symptoms" section if the path
for the UserControl project is C:\My Documents\VC#. RESOLUTION Use one of the following three methods to resolve this
problem. Method 1Rename the folder or the folders that contain the number sign (#).Method 2"Alias" the folder by sharing it, and then give the share a name that does not contain a number sign (#).For example, if your computer name is MyComputer, and if the project is located in the C:\My Documents\VC# folder, create a network share for this folder, and then name the share VCSharp. Open the project from the \\MyComputer\VCSharp share instead of the C:\My Documents\VC# folder. Method 3If the UserControl project does not have to be loaded as part of the current solution, remove the project from the solution, and then reference the compiled user control DLL directly.STATUSMicrosoft has confirmed that this is a bug in the Microsoft
products that are listed at the beginning of this article.
MORE INFORMATIONSteps to Reproduce the Behavior
APPLIES TO
| Article Translations
|
Back to the top
