Solving: Expected class, delegate, enum, interface, or struc

Tips submitted by ASP.NET Maker users
Post Reply
xgis
User
Posts: 68

Solving: Expected class, delegate, enum, interface, or struc

Post by xgis »

Troubleshooting an elusive error like this one can be difficult and may cause hours of downtime.
If you have imported a project from ASPMaker that has existing code this error may eventually surface.
When importing an existing project and resolving errors like this one ensure you make Zip/Rar Named and Dat Time based backups when ANM10 generation milestones are achieved.
Another good tip is to only work on one table at a time. eg smallest 1st, especially if you are not familiar with the new razor syntax or implementation of c# by the code generator.

ANM10 does not have an undo feature so if you make a change it is usually permanent. In this example it was actually the old commented code that caused the issue.
I had 10 plus coded pages that were commented in the migration process.
To resolve the error simply delete all the existing code for each "Code" event. It is OK to leave "Client Scripts" intact, at least for this error.
Regenerate your table and test and it should compile.

Open a 2nd copy of the application to view your deleted code.
Start rebuilding it section at a time then generate, test, repeat until all of your existing code is functional.
Once you have completed a table make a backup as a zip or rar then continue.
Don't forget to use structured and datetime based names so you don't get lost in your backups.

Do not rely on ANM10 backups for this type of troubleshooting because each time you save a normal backup is created.
You can only save 10 times before you first backup is overwritten.
That is why you backup the project manually as a zip or rar.


xgis
User
Posts: 68

Post by xgis »

This error may also appear in more simpler circumstances during testing where an extra fish brace "}" is present at the end of your code.
Don't forget to check for the simplest solutions first.


unicorn9005
User
Posts: 1

Post by unicorn9005 »

Another good tip is to only work on one table at a time. eg smallest 1st, especially if you are not familiar with the new razor syntax or implementation of c# by the code generator....???


watson


Post Reply