ASP.NET Web Application And Compilation [Question]

  • Thread starter Gerry O'Brien [MVP]
  • Start date
G

Gerry O'Brien [MVP]

If I'm not mistaken, compiling a Web app prior to deploying means that you
only have to deploy the dll files. Everything needed for the app is
included.

If you don't compile the web app prior to deployment, then you need to
ensure that the code files are deployed on the web server so the app can be
compiled when needed.
 
T

Tiraman

Hi,

Can some one explain me why do i need to compile a web application or in
other words ,

what is the deference between 2 web sites (same files) but one of them was
compiled and the other wasn't ?


10x

Best Regards ,

Tiraman :)
 
S

Steven Cheng[MSFT]

Hi Tiraman,

As for the complie for the asp.net web project(web application), here are
some of my understanding:

In fact, when we said that we need to compile a web application, that means
we'd compile the web project before deploy it to the server,yes? This
compile operation will build all the webform pages' codebehind page classes
or any other utility classes into the web application's main assembly(dll
file) which will be deployed to the web application's sub "bin" folder.
Then, when deploying the web project, we needn't copy the code source
files(.cs or .vb) to the deployment server) since all the classes has been
build into the main assembly(in "bin" folder).

At runtime, when a certain web page is requested, there occurs another
compilation------runtime compiling-------- this will generate the actual
class of the webpage(not the codebehind class in the assembly), the actual
class will be generated from the aspx source file and is derived from the
codebehind class contained in the assembly. And the runtime compiled page
classes is located in the ASP.NET's temporary folder. This runtime
compiliation can be set in the web.config via the <compilation> Element,

#<compilation> Element
http://msdn.microsoft.com/library/en-us/cpgenref/html/gngrfcompilationsectio
n.asp?frame=true

Then when the actual page class is generated, the ASP.NET runtiem will use
its instance to process the coming request for the certain page. For
detailed description, please reference the following links in MSDN:

#Creating and Managing Web Forms Pages
http://msdn.microsoft.com/library/en-us/vbcon/html/vboriCreatingEditingWebFo
rms.asp?frame=true

#Web Forms Code Model
http://msdn.microsoft.com/library/en-us/vbcon/html/vbconwebformscodemodel.as
p?frame=true

Hope helps. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top