BUG: You receive an error message if you change the case of a control name on the form (814357)
The information in this article applies to:
- Microsoft Visual Basic .NET (2003)
- Microsoft Visual Basic .NET (2002)
- Microsoft Visual C# .NET (2003)
- Microsoft Visual C# .NET (2002)
SYMPTOMS You may receive an error message when you build a project
on a Windows application if you do the following things:
- Set the Localizable property of the form to True.
- Set the Form Language property to a value other than default.
- Change the case of a control name on the form.
You receive the following error message:
Resource transformation for file 'FormName.resx' failed. Item has already been
added. Key in dictionary: "NewControlName.<Property Name>" Key being added: "ControlName.<Property Name>" This bug occurs only when you change the case of a
control name on the form. You may not receive the error when you change the
name of the controls. CAUSEWhen you set the Form Language property to a value other than default, Microsoft Visual Studio
.NET converts the language dependent properties to appropriate languages. These
property values are stored in a resource file with .resx extensions. When you
modify the name of a control, all the related keys are stored with the new name
in the resource file, and Visual Studio .NET deletes the old key entries. When
you change only the case of the control name, Visual Studio .NET adds the new
keys entry, but it does not delete the old key entries. This bug occurs because
the resource file contains more than one entry for the control.WORKAROUNDTo work around this problem, delete the old key entries in
the resource (.resx) file. To do this, follow these steps:
- Open Visual Studio .NET.
- On the File menu, point to
Open, and then click File.
- Locate the Form1.resx file, and then click
OK.
Form1.resx is displayed. - Locate the original key values, and then manually delete
them from the data list.
For example, you have a button named
Button1. You modify the name of this button to
BUTTON1. The key values for both Button1 and
BUTTON1 are in Form1.resx. Remove all the entries of
Button1, and then rebuild the project.
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.REFERENCES
For more information, click the following article number to view the article in the Microsoft Knowledge Base:
316643
BUG: The Resx file is not updated when you remove a control
Modification Type: | Minor | Last Reviewed: | 2/3/2006 |
---|
Keywords: | kbvs2005doesnotapply kbvs2005swept kbvs2002sp1sweep kbWindowsForms kberrmsg kbResource kbForms kbLocalization kbbug KB814357 kbAudDeveloper |
---|
|