nagesh said:
hi guys,
when we compiling the asp.net project, all codebehind pages gives you
one dll. suppose if i write the code in .aspx forms itself then is it
create a dll ?
When the application is hit for the first time, what happens depends on
several factors.
First Scenario : Batch Compilation (assuming using VS.NET with an assembly
in /bin):
If you have debug set to false in your web.config (which you ALWAYS should
in production), when the site first gets hit, you'll get a dynamic assembly
compiled for your global.asax that will contain the type ASP.global_asax.
You will then get one dynamic assembly compiled for the folder in which the
file you requested exists. For example, if you request default.aspx, you
will get one dll that contains each type in that folder and they will have a
namespace of _ASP. The "_" indicates that they have been batch compiled.
As each folder gets hit, a new dynamic assembly is compiled for that folder
and that assembly will have an _ASP namespace. If you were to dump all the
object on the heap at this point, you'd see all of these objects.
Second Scenario: Non-Batch Compilation
If debug is true in your web.config, OR if you are using the Src attribute
instead of CodeBehind, OR if you are using inline ASP.NET code (such as you
are suggesting), batching is disabled. (You can also explicitly disable
batching via your configuration file.) That means that you get one assembly
(one dll) for each page and they will all have an ASP namespace. I mention
the namespace only because it's an easy way to determine if batching is
enabled when you are looking at these types in a debugger. There are other
ways as well if you are intricately familiar with the inner structures of
ASP.NET.
Having batch compile disabled is a bad thing. The assemblies that get
created are not large, but they are loaded into no particular address space.
That means that they get scattered all over system memory. This greatly
increases the likelihood of an OutOfMemoryException occurring because it
causes fragmentation.
--
Jim Cheshire
JIMCO Software
http://www.jimcosoftware.com
FrontPage add-ins for FrontPage 2000 - 2003