If at first you don't succeed, call it version 1.0

Contact Me

Sarvesh Kushwaha
Email : sarveshkushwaha@outlook.com

Total Pageviews

Powered by Blogger.

Google+ Followers

Friday, 22 August 2014

ASP.NET Precompilation for Deployment


Benefits of Precompilation in ASP.NET:

  • Initial response of application will be faster for users, because code and files will not have to be compiled at the first time any user requested.
  • We can ensure error free application at compile time
  • From security concern people who have access to production server cannot see the source code and cannot make the changes(if you have chose the option of not updatable at the time of publish).
  • Large websites must use this precompilation.


How to enable precompilation for deployment :

At the time of publishing any asp.net application in the publish web wizard on the menu of Setting we can enable this precompilation : (Using Visual Studio 2012)
Steps :

  • In Visual Studio, open a web application project.
  • Right click the project name in Solution Explorer, and then choose Publish.
  • Select the Settings tab and check precopile during publishing.
  • Click Configure for advanced setting of precompilation.



























This Precompilation have some advanced properties also : Click on configure for advanced proprieties of precompilation.



































I do always prefer my application to choose "Allow precompiled site to be updatable" because its allows to me update my (.aspx, .cshtml, .ascx , partial views, master files) in application.
its very useful when you have to update your website for minor changes ,and you don't want to deploy a build again.
.

References and further readings:

ASP.NET Precompilation Overview
ASP.NET Web Application Project Precompilation Overview
Advanced Precompile Settings
For more ASP.NET applications Performance tips and tricks
Reactions:

4 comments:

  1. Great post, I think all should do it priority basis ( ASP.NET Precompilation for Deployment) . after reading this post i got the useful information about this. i am using ASP.NET Hosting from Myasp.net and now i am going to enable it.

    ReplyDelete
  2. Is there any command/option to uncheck this option using command or any option in .sln file to uncheck this

    ReplyDelete
  3. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a .Net developer learn from Dot Net Training in Chennai. or learn thru ASP.NET Essential Training Online . Nowadays Dot Net has tons of job opportunities on various vertical industry.

    ReplyDelete