Sam

Sam

  • NA
  • 166
  • 0

Error 1 Missing partial modifier on declaration

Dec 14 2014 3:11 AM
Hi, 
I have a strange situation in  WinXP, VS2008, Winform, C# :
 
My (old) Winform application runs OK, and I can modify and build normally.

Every now and then, at random times, the VS automatically adds an extra Main1.Designer.cs file under the Main.resx file.
As soon as this file is added, I get the error message: 
"Error 1 Missing partial modifier on declaration of type 'MyProgram.Main'; another partial declaration of this type exists"
 
I understand the reason for the error, but I do not understand what makes this file to be built.
 
If I delete the Main1 file, everything returns to normal, until the next time it shows up. 
Here is what I get in the Solution explorer: 
 
Main.cs
   Main.Designer.cs
   Main.resx
      Main1.Designer.cs   <this file is automatically built and can be deleted.
 
The new Main1.Designer is a template only, and does not have the actual data as in the Main.Designer. 
Important comment: The Designer and the resx files were originally copied from another program, and although they seem to work OK, they may lack the binding link to the Main.
Any idea?
thx