We recently upgraded our MVC3 site to MVC4 (will then step up to 5 when we're ready) and now all of a sudden Visual Studio 2013 [Update 3] is giving tons of "errors" in the Error List, that don't seem to be breaking the build but are all over the place and making it difficult to spot real errors.
<table ID="myNiftyTable" runat="server" style="vertical-align:top; width:600px">
And similar tags like , etc. are all giving that error message "ASP.NET attributes are only allowed in ASP.NET files." because of the runat="server" attribute.
We had used some scripting tools to convert the old .aspx Views into Razor .cshtml so the above element formerly looked like
<asp:Table ID="myNiftyTable" runat="server" Width="600px" HorizontalAlign="Left">
Should I, can I just get rid of all those runat="server"
attributes? The new web app seems to run OK in VS debug, but I haven't exhaustively tested all the pages & Controller methods yet so I'm not sure I want to do that, in case it breaks something.
runat="server" is only required by Webforms. It should not have been in your MVC 3 application either. You should definitely remove all references to them.
You should be able to do this with a Find & Replace across all views in your project without much difficulty.