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)?

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
Paul Alexander
  • 31,970
  • 14
  • 96
  • 151
  • As far as what I know, .net is not going to compile anything for aspx/ascx until they are first executed (or after modified). So all your changes should be reflected immediately after you modified. – xandy Jul 28 '09 at 16:28
  • Only when viewed in the browser - I don't want to browse each page to determine if it compiles. I'd like it to compile during build like it does with the Website option. – Paul Alexander Jul 28 '09 at 16:51

1 Answers1

2

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.

Community
  • 1
  • 1
Craig Stuntz
  • 125,891
  • 12
  • 252
  • 273