Events
Mar 17, 9 PM - Mar 21, 10 AM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
If the Windows Forms Designer fails to load due to an error in your code, in a third-party component, or elsewhere, an error page is presented instead of the designer. This error page doesn't necessarily signify a bug in the designer. The bug may be somewhere in the code-behind file. Errors appear in collapsible, yellow bars with a link to jump to the location of the error on the code page.
The error window is made up of various parts.
Yellow bar
The yellow collapsible bar is created for every error, grouped by description. The bar describes the compiler error preventing the designer from loading property. It includes these details:
Instances of this error
When the yellow error bar is expanded, each instance of the error is listed. Many error types include an exact location in the following format: <project name> <form name> Line:<line number> Column:<column number>. If a call stack is associated with the error, you can select the Show Call Stack link to see it. Examining the call stack might further help you resolve the error.
Important
The elements of an error might vary based on the code language you're using.
Help with this error
If a help article for the error is available, select the MSDN Help link to navigate directly to the help page.
Forum posts about this error
Select the Search the MSDN Forums for posts related to this error link to navigate to the old Microsoft Developer Network forums. You might want to search or ask a question on the Microsoft Q&A or StackOverflow forums.
You can often clear an error by cleaning and rebuilding the project or solution.
You can also try to delete the bin and obj folders from the project folder. This might clear a temporary file or cause a restore action to happen, fixing a bad dependency.
Use the following section to triage common design-time errors.
This section lists some of the errors you may encounter.
IComponent
interfaceMost commonly you see this error when you delete or rename an event handler in the code-behind file that's reference by the designer file. Open the <form>.designer.<langauge> code file and delete the event handler from the form or control.
This error indicates that a field, method, event, or object is improperly named.
You've specified a name for an inherited form that already exists in the project. To correct this error, give the inherited form a unique name.
A third-party designer tried to access a tab on the Toolbox that doesn't exist. Contact the component vendor.
Visual Studio attempted to a load a designer that's registered for the file type but could not. This is most likely because of an error that occurred during setup. Contact the vendor of the language you're using for a fix.
This error is a problem with a third-party component. Contact the component vendor.
A third-party designer requested that Visual Studio create an object, but the object raised an error. Contact the component vendor.
This error arises if you try to open a file that is already opened in another editor. The editor that already has the file open is shown. To correct this error, close the editor that has the file open, and try again.
Close and reopen the designer for the changes to take effect. Normally, Visual Studio automatically reloads a designer after changes are made. However, other designers, such as third-party component designers, may not support reload behavior. In this case, Visual Studio prompts you to close and reopen the designer manually.
This message is similar to "Another editor has '<document name>' open in an incompatible mode," but Visual Studio is unable to determine the file name. To correct this error, close the editor that has the file open, and try again.
Visual Studio only supports single-dimension arrays in the code block that's parsed by the designer. Multidimensional arrays are valid outside this area.
This error message arises when you try to open a file that could not be opened. Verify that the file exists and is a valid assembly.
This error is a problem with a third-party component. Contact the component vendor.
Visual Studio made a call to the Toolbox, which was not available. If you see this error, please log an issue by using Report a Problem.
This error most often arises when you've tried to connect an event to a control that's inherited from a base class. If the control's member variable is private, Visual Studio cannot connect the event to the method. Privately inherited controls cannot have extra events bound to them.
Visual Studio has tried to add an event handler to a component that does not have a member variable in the designer. Contact the component vendor.
This error is an internal error in the Visual Studio serializer. It indicates that the serializer has tried to name an object twice, which is not supported. If you see this error, please log an issue by using Report a Problem.
Inherited controls are under the ownership of their inheriting class. Changes to the inherited control must be made in the class from which the control originates. Thus, you cannot rename or destroy it.
The designer tried to reference a class on a particular Toolbox tab, but the class does not exist. Contact the component vendor.
A third-party designer has asked Visual Studio to create an object with particular parameters in the constructor that does not exist. Contact the component vendor.
This error is a generic wrapper for an error. The error string that accompanies this message gives more details about the error message and have a link to a more specific help article. To correct this error, address the error specified in the error message appended to this error.
This message is related to an error in the component you loaded or placed on the form. It indicates that the component did not add itself to its container control (whether that is another control or a form). The designer continues to work, but there may be problems with the component at run time.
To correct the error, contact the component vendor. Or, if it is a component you created, call the IContainer.Add
method in the component's constructor.
This error arises when you try to rename a component to an empty value.
This error can arise because of two scenarios. Either a third-party component vendor has a problem with a control or component they have distributed, or the code you have written has recursive dependencies between components.
To correct this error, ensure that your code does not have a recursive dependency. If it is free of such problems, note the exact text of the error message and contact the component vendor.
Error message: "Could not find type '<type name>'. Please make sure that the assembly that contains this type is referenced. If this type is a part of your development project, make sure that the project has been successfully built."
This error occurred because a reference was not found. Make sure the type indicated in the error message is referenced, and that any assemblies that the type requires are also referenced. Often, the problem is that a control in the solution has not been built. To build, select Build Solution from the Build menu. Otherwise, if the control has already been built, add a reference manually from the right-click menu of the References or Dependencies folder in Solution Explorer.
Visual Studio attempted to wire up an event-handling method and could not find one or more parameter types for the method. This error is usually caused by a missing reference. To correct this error, add the reference containing the type to the project and try again.
The templates for inherited forms in Visual Studio are not available. If you see this error, please log an issue by using Report a Problem.
Visual Studio has tried to create an event handler, but there is something wrong with the event type. This error can happen if the event was created by a non-CLS-compliant language. Contact the component vendor.
This error arises because a member variable has been declared twice (for example, two controls named Button1
are declared in the code). Names must be unique across inherited forms. Additionally, names cannot differ only by case.
This error can occur if there is a bad .resx file in the project.
To correct this error:
This error can occur if there is a bad .resx file in the project for the default culture.
To correct this error:
Error message: "Failed to parse method '<method name>'. The parser reported the following error: '<error string>'. Please look in the Task List for potential errors."
This is a general error message for problems that arise during parsing. These errors are often due to syntax errors. See the Task List for specific messages related to the error.
You've tried to rename a component to an invalid value for that language. To correct this error, name the component such that it complies with the naming rules for that language.
When you define a class in multiple files by using the partial keyword, you can only have one partial definition in each file.
To correct this error, remove all but one of the partial definitions of your class from the file.
This error is similar to "The type '<type name>' could not be found," but this error usually happens because of a metadata attribute. To correct this error, check that all assemblies used by attributes are referenced.
A component has requested a particular assembly, but the name provided by the component is not a valid assembly name. Contact the component vendor.
Visual Studio loaded the class, but the class cannot be designed because the implementer of the class did not provide a designer. If the class supports a designer, make sure there are no problems that would cause issues with displaying it in a designer, such as compiler errors. Also, make sure that all references to the class are correct and all class names are correctly spelled. Otherwise, if the class is not designable, edit it in Code view.
The class is not referenced in the project, so Visual Studio can't load it. To correct this error, add a reference to the class in the project, and close and reopen the Windows Forms Designer window.
The designer for this control or component does not support the same types that Visual Studio does. Contact the component vendor.
The source code created by the user has a class name that isn't valid for the language being used. To correct this error, name the class such that it conforms to the language requirements.
You cannot add a control or component to itself. Another situation where this might occur is if there is code in the InitializeComponent method of a form (for example, Form1
) that creates another instance of Form1
.
This error occurs when the file in the editor is marked as read-only. Ensure that the file is not marked read-only and the application is not running.
This error occurs when Visual Studio cannot find a base class that satisfies designer requirements. Forms and controls must derive from a base class that supports designers. If you're deriving from an inherited form or control, make sure the project has been built.
Visual Studio could not load the designer for the class. If you see this error, please log an issue by using Report a Problem.
This error occurred because the base class of the object being passed to the designer is abstract, which is not allowed.
The base class of this file does not support any designers. As a workaround, use Code view to work on the file. Right-click the file in Solution Explorer and choose View Code.
Error message: "The language for this file does not support the necessary code parsing and generation services. Ensure the file you are opening is a member of a project and then try to open the file again."
This error most likely resulted from opening a file that's in a project that does not support designers.
Error message: "The language parser class '<class name>' is not implemented properly. Contact the vendor for an updated parser module."
The language in use has registered a designer class that doesn't derive from the correct base class. Contact the vendor of the language you're using.
This is an internal error in the Visual Studio serializer. If you see this error, please log an issue by using Report a Problem.
Visual Studio tried to create a component, but the object created does not implement the IComponent interface. Contact the component vendor for a fix.
There are some .NET properties that should always return an object. For example, the Controls collection of a form should always return an object, even when there are no controls in it.
To correct this error, ensure that the property specified in the error is not null.
A data object offered by the serializer is not an instance of a type that matches the current serializer being used. Contact the component vendor.
A service required by Visual Studio is unavailable. If you tried to load a project that doesn't support that designer, use the Code Editor to make the changes instead. Otherwise, If you see this error, please log an issue by using Report a Problem.
This error indicates that a component or component designer has called the AddService method, which requires an interface and object, but the object specified does not implement the interface specified. Contact the component vendor.
This error occurs when Visual Studio is unable to edit a file due to disk space or memory problems, or the file is marked read-only.
If you see this error, If you see this error, please log an issue by using Report a Problem.
The component in question threw an exception when Visual Studio accessed it. Contact the component vendor.
This error occurs if the data within the Toolbox item becomes corrupted or the version of the component has changed. Try removing the item from the Toolbox and adding it back again.
When the designer is loaded, Visual Studio failed to find a type. Ensure that the assembly containing the type is referenced. If the assembly is part of the current development project, ensure that the project has been built.
Visual Studio attempted to access required resources from the wrong thread. This error is displayed when the code used to create the designer has called the type resolution service from a thread other than the main application thread. To correct this error, call the service from the correct thread or contact the component vendor.
The source code has a reference to a variable, such as Button1, that isn't declared or assigned. If the variable has not been assigned, this message appears as a warning, not an error.
This error arises if a third-party designer adds a command that already has a handler to the command table. Contact the component vendor.
Error message: "There is already a component named '<component name>'. Components must have unique names, and names must not be case-sensitive. A name also cannot conflict with the name of any component in an inherited class."
This error message arises when there has been a change to the name of a component in the Properties window. To correct this error, ensure that all component names are unique, are not case-sensitive, and do not conflict with the names of any components in the inherited classes.
A third-party component made a callback to an item on a Toolbox tab, but the item already contained a callback. Contact the component vendor.
This message is similar to "The language for this file does not support the necessary code parsing and generation services," but this message involves an internal registration problem. If you see this error, If you see this error, please log an issue by using Report a Problem.
Visual Studio could not find a constructor that had matching parameters. This error may be the result of supplying a constructor with types other than those that are required. For example, a Point constructor might take two integers. If you provided float types, this error is raised.
To correct this error, use a different constructor or explicitly cast the parameter types such that they match those provided by the constructor.
Visual Studio is unable to add a reference. To correct this error, check that a different version of the reference is not already referenced.
This error arises when you change a file that's currently checked in to source-code control. Usually, Visual Studio presents the file checkout dialog box so that the user can check out the file. This time, the file was not checked out, perhaps because of a merge conflict during checkout. To correct this error, ensure that the file is not locked, and then try to check out the file manually.
This error arises when a component designer requests access to a page from the Options dialog box by using a name that does not exist. Contact the component vendor.
This error arises when a component designer requests access to a particular value on a page from the Options dialog box, but that value does not exist. Contact the component vendor.
Visual Studio loaded the class, but the designer for that class could not be loaded. Visual Studio requires that designers use the first class in a file. To correct this error, move the class code so that it is the first class in the file, and then load the designer again.
This is a problem with a third-party component. Contact the component vendor.
This error indicates that the language of the project does not support a designer and arises when you attempt to open a file in the Open File dialog box or from Solution Explorer. Instead, edit the file in Code view.
Visual Studio loaded the class, but the class cannot be designed. Instead, edit the class in Code view by right-clicking the class and choosing View Code.
.NET Desktop feedback feedback
.NET Desktop feedback is an open source project. Select a link to provide feedback:
Events
Mar 17, 9 PM - Mar 21, 10 AM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowTraining
Learning path
Use advance techniques in canvas apps to perform custom updates and optimization - Training
Use advance techniques in canvas apps to perform custom updates and optimization
Documentation
Design-time errors in the Windows Forms Designer
Learn about the errors that occur when the Windows Forms Designer fails to load due to an error in your code, in a third-party component, or elsewhere.