July 28 2008

Visual Studio Designer File Out Of Sync / Not Regenerating

I thought this was a rare occurance, but for whatever the reason, two people I know experienced an out of synchronisation aspx.designer.cs file in two days.

Firstly, make sure you’re not just being stupid :) Check that your .aspx page directive has a correct Codebehind property.  Check the namespace AND the code file class name.  Copy and paste them together to see if it looks the same.

Now the actual fix, if that doesn’t work:

  1. Delete the offending .aspx.designer.cs file
  2. Right-click on the .aspx file and select “Convert to Web Application”
  3. Your designer file should be regenerated or an exception message will be shown why the file can’t be regenerated.
  4. If you get an exception, fix the problem and perform steps 2 and 3 again.

tadah!

Comments (View)
blog comments powered by Disqus

Please...

Leave a comment if this has helped or offended you.

StackOverflow Id