The Visual Studio .NET IDE designer fails when implementing an inherited form programmatically in Managed Visual C++ .NET or Visual C++ 2005 (815325)
The information in this article applies to:
- Microsoft Visual C++ 2005 Express Edition
- Microsoft Visual C++ .NET (2003)
SYMPTOMS When
you try to inherit a form
from another form programmatically in the same Managed Visual C++ Windows Form
application, the program builds correctly. However, when you try to view the
inherited form in Design view in the Microsoft Visual Studio .NET or Microsoft Visual Studio 2005 IDE Designer, you may receive the following error message: The designer could not be shown for this file because none of the
classes within it can be designed. The designer inspected the following classes
in the file: <Inherited Form Name> --- The base class '<base class
name>' could not be loaded. Ensure the assembly has been referenced or built
if it is part of the project. You may also receive the error
message in the Task List window. WORKAROUNDTo work around this problem, create a separate Managed Class
Library that contains the base form class that must be inherited. Build the
class library, and then reference the base form class from the application that
contains the inherited form. To do this, follow these steps:
- Create a Microsoft Visual C++ Class Library (.NET) project
in Visual Studio .NET (2003).
The project must contain the base form
class.
Note In Microsoft Visual Studio 2005, create a Microsoft Visual C++ Class Library project. - Create a Visual C++ Windows Form application (.NET) project
in Visual Studio .NET (2003). The Windows Form application must contain the derived
form class.
- In Solution Explorer, right-click
References, and then click Add Reference.
- In the Add Reference dialog box, click the
.NET tab, and then click Browse.
- In the Select Component dialog box,
select the class library
dynamic-link library (DLL) that was generated in step 1.
Click OK to close the Add Reference dialog
box.
- Change the base class of the form to the form that is
contained in the class library DLL.
View the form in
Design view.
STATUS Microsoft
has confirmed that this is a problem in the Microsoft products that are listed
at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 1/6/2006 |
---|
Keywords: | kberrmsg kbprb kbide KB815325 kbAudDeveloper kbAudITPRO |
---|
|