views:

67

answers:

1

When working with the "Web Site" style ASP.NET project, VS.NET will compile all the ASPX/ASCX pages during the build process. This is great cause it validates all the embedded code. For most sites I don't have much, but with MVC I've got lots of <%= Html.Action(...) %> style snippets throughout. When refactoring the .CS files get updated, but the ASPX/ASCX files aren't always updated and I don't learn about it until I try and view the page in a browser and get the YSOD. I'd like to compile the entire site ASPX & all as part of the build process to catch these issues early.

Is there a way to pre-compile all the ASPX/ASCX files as part of the build process for a Web Application (Not Website)?

+2  A: 

Yes and no. You can cause ASPX/ASCX to be compiled during build, but IIS/ASP will still recompile when deploying. It does do the error checking you want, though.

Craig Stuntz
Yep, that's what I needed!
Paul Alexander