views:

79

answers:

2

Hi all,

I've recently upgraded an ASP.NET MVC Project written with the Beta version of the framework to the use the full 1.0 version. Part of this process involved deleting all the unused code-behind files associated with the view pages.

However, since I've done this, whenever I open an .aspx or .ascx in Visual Studio, I get hundreds of parse errors in the VS error list that bear no relation to what's in the file. 'Syntax error', 'End of Statement Expected', 'Statement cannot appear outside method body', etc., all repeated tens of times, right up to 'Maximum number of errors has been exceeded'. None of the errors have any line or column numbers, and most of the views contain hardly any server-side code at all. This is more than just a mild annoyance because it means I lose Intellisense when editing a view and I can't see when any real errors are flagged up.

The solution builds, and every view is processed and renders fine at run-time, but the errors in Visual Studio remain.

I've searched online for solutions to this and can't find any, so I'm hoping someone can point me towards what I'm doing wrong. I'm thinking I may have to create a new 1.0 project from scratch and port the files across, however I'd rather not have to do this as it's a large project.

Thanks in advance

A: 

Whilst it is a bullet to swallow, I think you will find that moving to a "new" 1.0 project will bring bonuses you won't see any other way.

The context menu actions for MVC projects and items are the one I found most pleasing. I tried more than a few nights to "upgrade" my MVC preview projects but to no avail.

Sorry to not have a nicer answer for you (at least you have a little carrot now!)

Kindness,

Dan

I did find I could reduce the phantom error count somewhat by deleting the projects .SUO file.

Daniel Elliott
I created a new project, copied the files over, but the problem remains! I get these messages in the new project too, so perhaps the problem is with the view files? I did overwrite the old project with the new one in the same directory too.
Lee D
+1  A: 

Idiot alert!

In my haste when editing the page directives to remove the references to the Code Behind files, I accidentally deleted the 'Language="C#"' directive from the some of the view pages. This is what was causing the parsing errors!

Turns out re-creating the whole project was a waste of time!

Just goes to show you need to check the small things first...

Lee D