A simple answer would be to start a new project and copy across your code bit by bit, checking that it compiles ok as you go.

You can cut-and-paste the controls from the forms and also cut-and-paste the code that you have written. Do not copy the Windows Generated Code, let the IDE generate that for itself in the new project.

This will probably fix the problem, although it will be hard work if you've got a big project, and you'll never find out what actually caused the error (although you may not care...)