2007/12/24 10:04
Error message when try to add a new form to a Visual C# project in Visual Studio 2005: "The code within the method 'InitializeComponent' is generated by the designer and should not be manually modified" General .NET2007/12/24 10:04
SYMPTOMS
You upgrade a Microsoft Visual C# project from Microsoft Visual Studio 2003 to Microsoft Visual Studio 2005. When you try to add a new form to the project, you may receive an error message that resembles the following:
The designer cannot process the code at line 32: this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; The code within the method 'InitializeComponent' is generated by the designer and should not be manually modified. Please remove any changes and try opening the designer again.
Additionally, when you try to open the existing forms in the project, you receive the same error message.Note This problem occurs in design mode. When you compile the project, you receive no error messages.
Method 1
Check the default namespace of the project. Make sure that the default namespace does not contain the ".System" string.
Method 2
Change the code as follows:
Original string
System.Windows.Forms
Replacement stringglobal::System.Windows.Forms
'General .NET' 카테고리의 다른 글
| Assembly DisplayName, Loading, Configuration File, Probing (0) | 2008/01/09 |
|---|---|
| Base 64 디코딩 스크립트 (0) | 2008/01/06 |
| Error message when try to add a new form to a Visual C# project in Visual Studio 2005: "The code within the method 'InitializeComponent' is generated by the designer and should not be manually modified" (0) | 2007/12/24 |
| 12월 18일자 마이크로소프트 뉴스레터의 일부 (0) | 2007/12/24 |
| ASP.NET MVC Framework (Part 1) (0) | 2007/12/17 |
| HttpWebRequest (0) | 2007/12/17 |
