About Phew

Phew is an utility for aspx page compilation. Sometimes when you test-drive an aspx page, you need a reference to this particular page class in your tests. In addition, you need to reference intrinsic Web classes that this page depends on: a master page class, various App_Code classes, user controls etc. Typically, you would use site precompilation to create required assemblies. Howewever, recompiling the whole site can be a long process, which is not acceptable in test driven development, where the change cycles should be as fast as possible.

For this reason, I decided to develop this simple utility. It compiles a single page into its own assembly (like the aspnet compiler does) and copies it to a destination directory, optionally with all assemblies that it depends on. It still takes a couple of seconds (mainly because the job is done in a separate AppDomain, which should be created for this purpose), but it's much faster than recompiling the whole site when all you did is a small change in one page.

How to use

Phew is a command-line tool that accepts three or four arguments:

Phew [sitePath] [outputPath] [filePath] [copyAll]

  • sitePath: the physical path to the site.
  • outputPath: the path for the compiled assemblies.
  • filePath: the Url of the file to be compiled, like ~/Default.aspx (can be absolute or app relative).
  • copyAll (optional): if true, copies all related assemblies; defaults to false (copies only the compiled page).

Note that when testing with Ivonna, you would probably need the whole precompiled site (you can't have both the source page and the compiled assembly in one site). So, first you precompile the site as described in the docs, then you use Phew for faster recompiling of individual pages.

On the other hand, you would probably spend more time developing App_Code classes, since you wouldn't want your views to contain much logic. In that case, use any page and set the 4th argument to true, and your App_Code classes will be recompiled.

Of course, the next logical step would be to create a VS add-in, but don't expect it too soon.


Site Map | Printable View | © 2008 - 2012 Your Company Name

Powered by mojoPortal | HTML 5 | CSS | Design by styleshout