Monday, May 10, 2010

Updating a single page in a precompiled web site.

Hi,

Problem:

I have a precompiled website in the production server.

The website is compiled with:

fixed names (use fixed names... = true)
not updatable (allow this site to be updatable = false).
I would like to re-deploy a single page, without deploying the entire website, in order to avoid regression tests.

Currently, when I precompile the website again(using publish), and deploy only a single page, by copying only the .dll and .compiled files to the bin folder in the production server, I get:

System.Web.HttpException: The file 'xxxxxxx' has not been pre-compiled, and cannot be requested.


How can I re-deploy only a single page to an existing website ?


Making this site updateable (allow this site to be updatable = false) is not an option, for security reasons.

Solution:

With "not updatable" option, all the code, including markup, will be compiled into assembly, and ASP.NET will generate .compiled file to link the page and assembly. Every publish has random filehash in .compiled file when we make change in website.

In your case, we need to copy the Bin folder of new Publish to replace the old Bin folder in server. This will update .dll and .compiled files. The .aspx files just are marker files, we don't need to update them.

The operation above is similar to re-deploy entire website. Since publish with "not updatable" option is only designed for deployment.

Happy Programming!!!

No comments:

Post a Comment