A set of .NET Framework managed libraries for developing graphical user interfaces.
Hi @Michael Pettigrew ,
I’m working on this issue and will try to get back to you soon. Thank you for your patience.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I get the following error when trying to save a control after changing a property in the Forms Designer:
Visual Studio Forms Designer: The given key 'reader' was not present in the dictionary.
What causes this error? I have two minimal user controls defined in a project. One of them works and the other does not.
A set of .NET Framework managed libraries for developing graphical user interfaces.
Hi @Michael Pettigrew ,
I’m working on this issue and will try to get back to you soon. Thank you for your patience.
AI answer
This error indicates a Windows Forms Designer design-time failure, not necessarily a bug in the designer itself. The failure can be caused by code in the control, designer-generated code, missing references, build issues, or a third-party component.
For a case where one minimal user control works and another does not, the most relevant supported causes to check are:
.Designer file for mismatched control names in declarations, initialization, property assignments, or event hookups. Correct only obvious mismatches, then rebuild.A practical way to isolate the cause between the two controls is:
.Designer files for differences in declarations, initialization, and event wiring.The provided documentation does not identify a specific documented cause for the exact message "The given key 'reader' was not present in the dictionary". It supports treating it as a general design-time error and checking code, references, build state, and designer-generated code first.
References: