Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

Source: Microsoft Support

RAPID PUBLISHING

RAPID PUBLISHING ARTICLES PROVIDE INFORMATION DIRECTLY FROM WITHIN THE MICROSOFT SUPPORT ORGANIZATION. THE INFORMATION CONTAINED HEREIN IS CREATED IN RESPONSE TO EMERGING OR UNIQUE TOPICS, OR IS INTENDED SUPPLEMENT OTHER KNOWLEDGE BASE INFORMATION.

Symptom

Symptom 1
------------------
When attempting to add an inherited form using Visual Inheritance in a Visual Basic or C# project, you receive the following error:

"Warning: No built assemblies contain components to inherit from. Build the current application, or click Browse and select a previously built assembly from another application."


Symptom 2
------------------ 
When attempting to open an inherited form in the Windows Form Designer, the following error is displayed.

"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: <filename>  <class name> --- The base class '<base class name>' could not be loaded. Ensure the assembly has been referenced and that all projects have been built. "

Cause

The Form Designer requires a compiled assembly in order to display an inherited form. If the base form class is contained within an assembly that was compiled using the x64 or Itanium options, they cannot be opened by the Form Designer. This is because Visual Studio is a 32-bit process, and cannot execute code in a 64-bit (x64 or Itanium) module.

Resolution

Make sure the base form(s) are defined in an assembly that is compiled using the "AnyCPU" build option. This allows form classes defined within the assembly to be used in either a 32-bit process (such as Visual Studio), or in a 64-bit custom process.

More Information

Steps to Reproduce Problem
=======================
1. Create a new Windows Forms project. By default, Form1 is created.
2. On the Project menu, click <project name> Properties to view the project's properties.
3. If you are using Visual Basic, click the Compile tab, then click Advanced Compile Options. Set the Target CPU to "x64", and click OK. If you are using Visual C#, click the Build tab, and set the Platform Target to "x64".
4. On the Build menu, click Build Solution. This will build an assembly targeting the x64 platform.

Steps to Reproduce Symptom 1
---------------------------------------------
5. On the Project menu, click Add New Item.
6. Select Windows Forms, select Inherited Form, and then click Add.

Note that you receive the error "Warning: No built assemblies contain components to inherit from. Build the current application, or click Browse and select a previously built assembly from another application." This occurs even if you browse for and manually select the class library assembly you compiled previously.

Steps to Reproduce Symptom 2
-----------------------------------------------
7. On the Project menu, click Add Class. Select the default name (class1), and click Add.
8. If you are using Visual Basic, use this code in the class file.

Imports System.Windows.Forms
Public Class Class1
   Inherits Form1
End Class

9. If you are using Visual C#, use this code in the class file.

using System;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    class Class1:Form1
    {
    }
}

10. On the Build menu, click Build Solution. The project should compile.
11. Attempt to open the Class1 inherited form in the Windows Form Designer.

Note that you receive the error: "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: Class1 --- The base class 'WindowsApplication1.Form1' could not be loaded. Ensure the assembly has been referenced and that all projects have been built.


 

DISCLAIMER

MICROSOFT AND/OR ITS SUPPLIERS MAKE NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY, RELIABILITY OR ACCURACY OF THE INFORMATION CONTAINED IN THE DOCUMENTS AND RELATED GRAPHICS PUBLISHED ON THIS WEBSITE (THE “MATERIALS”) FOR ANY PURPOSE. THE MATERIALS MAY INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS AND MAY BE REVISED AT ANY TIME WITHOUT NOTICE.


TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, MICROSOFT AND/OR ITS SUPPLIERS DISCLAIM AND EXCLUDE ALL REPRESENTATIONS, WARRANTIES, AND CONDITIONS WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO REPRESENTATIONS, WARRANTIES, OR CONDITIONS OF TITLE, NON INFRINGEMENT, SATISFACTORY CONDITION OR QUALITY, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THE MATERIALS.

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Was this information helpful?

What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×