Tags: , | Posted by elron on 11/9/2010 1:04 AM | Comments (0)

Web Deployment Project (WDP) provides a way to pre-compile a web *site* project into single assembly in ASPNET 2.0.    Rick Strahl's useful blogpost articulates on this.  In a Visual Studio 2005 project,  though the web project is already Web Application Project (or WAP which already comes in SP1), we still use files from Web Deployment Projects (WDP) output for deployment.  From the host choices for WDP and due to several community feedbacks, the chosen method is to  "Merge All outputs to a single Assembly".   This would still maintain simplicity and familiarity to the old but proven Visual Studio 2003 compilation model and also adds other features unique to WDP rather than just copying files from the WAP project folder directly.   

 Several things to remember when using WDP.

  • In a WDP  project properties, a different filename must be specified to the main assembly and by default we use the _deploy naming convention.
  • Be sure to deploy also the following files:
    • PrecompiledApp.config - this file prevents server recompilation of pages.
    • App_global.asax.compiled - this file in the bin folder tells what assembly is global.asax compiled into.
  • Global.asax is not copied to the WDP output. 
    • Therefore , it is not needed to be deployed.   The file App_global.asax.compiled is supposed to tell ASPNET that ASP.global_asax is already in the "*deploy.dll" assembly.

 

  • A lot of other developers insists that if global.asax is not deployed,  events on global.asax are not fired.  This is not so in my case.
  • Forgetting to include the files above will result to an error as below:

    The type 'ASP.global_asax' exists in both ...

 

 

VS 2005 WDP download link is now hard to find so here I shall include it here, together with other versions:

 

 

 

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading