2

I've been converting some web site projects to web application projects. This involves using some automated tools to make many, many changes across projects. Oftentimes, the files become syntactically incorrect. When this happens to the codebehind files, I get a compile-time error and I know to fix the problem.

However, when the code in global.asax or the code inside of <% %> in the aspx files becomes incorrect, I ordinarily don't see any error until run-time. However, if I open up the aspx files in the code editor, I see the errors in the VS Error List.

One way of looking for errors would be to open up every asax and aspx file in the code editor and look at the error list. However, it seems that there ought to be some simple way to check for errors on all files.

How can I do this?

Vivian River
  • 31,198
  • 62
  • 198
  • 313

2 Answers2

1

You need to run ASP.NET pre-compilation. This will perform the same compilation steps that both IIS and Visual Studio do to get a list of compilation errors.

Igor Zevaka
  • 74,528
  • 26
  • 112
  • 128
  • Is there an easy way to see the pre-compilation errors in Visual Studio 2k8? – Vivian River Jul 20 '10 at 13:02
  • Maybe if you make recompilation a postbuild step. Not sure if the error go to the errors pane with that setup, but they'd definitely show up in the output window. – Igor Zevaka Jul 20 '10 at 21:24
  • To add the pre-compilation as a post-build step and get the results in your VS Error List window, see http://stackoverflow.com/questions/12511368/how-to-get-aspnet-compiler-invoked-from-visual-studio-during-build – kevinpo Mar 08 '16 at 21:59
1

If you using ReSharper, you can use it's function "Find code issues" and it will show you errors you are looking for in "ASP Errors" and "Asxx Errors" sections of inspection results

ρяσѕρєя K
  • 132,198
  • 53
  • 198
  • 213
Lucky
  • 13
  • 2