Errors when parsing errors after removing code from an ASP.NET MVC project

I recently updated an ASP.NET MVC project written by a beta framework to use the full version 1.0. Part of this process involved removing any unused code files associated with view pages.

However, since I did this, whenever I open an .aspx or .ascx in Visual Studio, I get hundreds of parsing errors in the VS error list that have nothing to do with what's in the file. "Syntax error", "End of expected statement", "Statement cannot appear outside the method body", etc., all repeated dozens of times, up to "Maximum number of errors exceeded". None of the bugs have row or column numbers, and most views contain little to no server side code. This is more than just a slight annoyance because it means I lose Intellisense while editing the view and I can't see when real errors will be flagged .

The solution builds and each view is processed and rendered at runtime, but bugs persist in Visual Studio.

I have searched the web for solutions for this and cannot find it, so I hope someone can point me to what I am doing wrong. I think I might have to create a new 1.0 project from scratch and port the files, but I don't want to do that as this is a large project.

Thank you in advance

+2


source to share


2 answers


An idiotic warning!

In my rush while editing page directives to remove links to "Code behind" files, I accidentally removed the "Language =" C # "" directive from some view pages. This is what was causing the parsing errors!



It turns out that re-creating the entire project was a waste of time!

Just to show that you need to check the little things first ...

+1


source


While this is a bullet to digest, I think you'll find that moving to a "new" 1.0 project will bring bonuses that you won't see otherwise.

The context menu actions for MVC projects and elements is the one I found the most enjoyable. I tried more than a few nights to "refresh" my MVC preview projects, to no avail.

Sorry you don't have a better answer (at least you have carrots!)



Kindness,

Dan

I found that I could reduce the phantom errors by deleting the .SUO project files.

0


source







All Articles