Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: When are ASPX files Recompiled


Message #1 by kamathamit@p... on Mon, 23 Apr 2001 05:25:31
Hi,



  From what i have read & seen ASPX files get compiled when they are 

created for the First time or when ever changes are made. It seems to me 

that the Files are also recompiled when I Reboot my system!! 



Can some one Clarify this?



Thanks in advance



Amit 



Message #2 by "Juan T. Llibre" <j.llibre@c...> on Mon, 23 Apr 2001 07:17:26 -0500
They are compiled when CALLED for the first time by any browser.



They are recompiled when called by any browser,

after changes have been made to their source code.



The reason your files are recompiled when they are

called after you reboot is, of course, that IIS has been

stopped and restarted by the reboot, so in effect it's as

if they are being called for the first time.



( The IIS application has been stopped and restarted... )



regards,





Juan T. Llibre

Microsoft MVP [IIS/ASP]

ASP.Net En Espaņol : http://207.176.17.140/

http://p2p.wrox.com/subscribe.asp?list=aspx_espanol

http://www.asplists.com/asplists/aspnges.asp

==================================



----- Original Message -----

From: <kamathamit@p...>

Sent: Monday, April 23, 2001 5:25 AM

Subject: [aspx] When are ASPX files Recompiled





>   From what i have read & seen ASPX files get compiled when they are

> created for the First time or when ever changes are made. It seems to me

> that the Files are also recompiled when I Reboot my system!!

>

> Can some one Clarify this?

> Amit





Message #3 by "Scott Davis" <Scott.D@e...> on Mon, 23 Apr 2001 07:54:17 -0400
There is a slight difference in the re-compile that happens after IIS 

has

been restarted.



When a page is requested for the first time, ASP.NET actually writes a 

C#

class for the page.  This class will either inherit directly from

System.Web.UI.Page (Beta 2) or if you are using code behind it will 

inherit

directly from your code behind class.  After the class is written, it is

compiled using the command line compiler csc.  Obviously, the result is 

a

.NET assembly which contains MSIL code.  This assembly is then JITted to 

x86

code and cached.  Subsequent requests to the page simply refer to the 

cached

x86 code.



If IIS is restarted, the only compilation that re-occurs for the page is 

the

JIT to x86 code.  The class that ASP.NET writes for the page is not

re-written unless the code changes.  So this step and the compilation to 

a

.NET assembly are skipped.



Hope that further clarifies it for you.



Scott Davis



-----Original Message-----

From: Juan T. Llibre [mailto:j.llibre@c...]

Sent: Monday, April 23, 2001 8:17 AM

To: ASP+

Subject: [aspx] Re: When are ASPX files Recompiled





They are compiled when CALLED for the first time by any browser.



They are recompiled when called by any browser,

after changes have been made to their source code.



The reason your files are recompiled when they are

called after you reboot is, of course, that IIS has been

stopped and restarted by the reboot, so in effect it's as

if they are being called for the first time.



( The IIS application has been stopped and restarted... )



regards,





Juan T. Llibre

Microsoft MVP [IIS/ASP]

ASP.Net En Espa=F1ol : http://207.176.17.140/

http://p2p.wrox.com/subscribe.asp?list=3Daspx_espanol

http://www.asplists.com/asplists/aspnges.asp

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

=3D=3D=3D=3D=3D=3D=3D=3D=3D



----- Original Message -----

From: <kamathamit@p...>

Sent: Monday, April 23, 2001 5:25 AM

Subject: [aspx] When are ASPX files Recompiled





>   From what i have read & seen ASPX files get compiled when they are

> created for the First time or when ever changes are made. It seems to 

me

> that the Files are also recompiled when I Reboot my system!!

>

> Can some one Clarify this?

> Amit

Message #4 by "Juan T. Llibre" <j.llibre@c...> on Mon, 23 Apr 2001 08:25:34 -0500
Does that happen even if the page is written in VB ?

Every page written in VB is compiled to a C# class ?



That sounds fishy...;>)



I would assume that VB code is compiled by vbc.



I suppose I could have been clearer about which

"compilation" was being referenced.



The INITIAL compilation ( by the developer ) produces MSIL

and is done in whichever language the developer chose to write in.



The JITting occurs when a browser calls the page.



The JIT compilation should be language-independent

and is handled by the CLR. Is THAT what you're saying

is compiled to a C# class ?



If that's the case, VB is dead.

( Why "translate" VB to C# if you can write in C# to start with ? )



Also, I assume that recompilation after restart

only occurs if the page is called, right ?







Juan T. Llibre

==========



----- Original Message -----

From: "Scott Davis" <Scott.D@e...>

To: "ASP+" <aspx@p...>

Sent: Monday, April 23, 2001 6:54 AM

Subject: [aspx] Re: When are ASPX files Recompiled





There is a slight difference in the re-compile that happens after IIS has

been restarted.



When a page is requested for the first time, ASP.NET actually writes a C#

class for the page.  This class will either inherit directly from

System.Web.UI.Page (Beta 2) or if you are using code behind it will inherit

directly from your code behind class.  After the class is written, it is

compiled using the command line compiler csc.  Obviously, the result is a

.NET assembly which contains MSIL code.  This assembly is then JITted to x86

code and cached.  Subsequent requests to the page simply refer to the cached

x86 code.



If IIS is restarted, the only compilation that re-occurs for the page is the

JIT to x86 code.  The class that ASP.NET writes for the page is not

re-written unless the code changes.  So this step and the compilation to a

.NET assembly are skipped.



Hope that further clarifies it for you.



Scott Davis



-----Original Message-----

From: Juan T. Llibre [mailto:j.llibre@c...]

Sent: Monday, April 23, 2001 8:17 AM

To: ASP+

Subject: [aspx] Re: When are ASPX files Recompiled





They are compiled when CALLED for the first time by any browser.



They are recompiled when called by any browser,

after changes have been made to their source code.



The reason your files are recompiled when they are

called after you reboot is, of course, that IIS has been

stopped and restarted by the reboot, so in effect it's as

if they are being called for the first time.



( The IIS application has been stopped and restarted... )



regards,





Juan T. Llibre

Microsoft MVP [IIS/ASP]

ASP.Net En Espaņol : http://207.176.17.140/

http://p2p.wrox.com/subscribe.asp?list=aspx_espanol

http://www.asplists.com/asplists/aspnges.asp

==================================



----- Original Message -----

From: <kamathamit@p...>

Sent: Monday, April 23, 2001 5:25 AM

Subject: [aspx] When are ASPX files Recompiled





>   From what i have read & seen ASPX files get compiled when they are

> created for the First time or when ever changes are made. It seems to me

> that the Files are also recompiled when I Reboot my system!!

>

> Can some one Clarify this?

> Amit



Message #5 by "Scott Davis" <Scott.D@e...> on Mon, 23 Apr 2001 09:40:09 -0400
Comments in-line

----

>Does that happen even if the page is written in VB ?

>Every page written in VB is compiled to a C# class ?



No, that does happen if the page is written in VB.  Sorry, I should have

mentioned that.  If you are using VB, a VB.NET class will be written by

ASP.NET and compiled using the VB.NET command line compiler.  Everything 

else

would still apply.



>I would assume that VB code is compiled by vbc.



You are right.



>The INITIAL compilation ( by the developer ) produces MSIL

>and is done in whichever language the developer chose to write in.



>The JITting occurs when a browser calls the page.



>The JIT compilation should be language-independent

>and is handled by the CLR. Is THAT what you're saying

>is compiled to a C# class ?



The intial compilation that you are talking about only compiles your 

code

behind VB.NET or C# class down to a .NET assembly (MSIL).  When the page 

is

requested for the first time, ASP.NET will write a VB.NET or C# class 

that

inherits from your code behind class.  There are many reasons that this 

must

be done, but one of the main reasons is that you can still include code 

in a

<script> block even if you are using code behind.  Any methods that you 

may

have written in a <script> block would be added to the class that is 

created

dynamically by ASP.NET.  So in effect, all of the code in your code 

behind

class is combined with any code in <script> blocks (as well as code in 

<% %>

tags) into one class and then compiled by the appropriate compiler.  It 

is

the assembly file resulting from this compilation that is then JITed.



>Also, I assume that recompilation after restart

>only occurs if the page is called, right ?



Right.



Scott Davis



----- Original Message -----

From: "Scott Davis" <Scott.D@e...>

To: "ASP+" <aspx@p...>

Sent: Monday, April 23, 2001 6:54 AM

Subject: [aspx] Re: When are ASPX files Recompiled





There is a slight difference in the re-compile that happens after IIS 

has

been restarted.



When a page is requested for the first time, ASP.NET actually writes a 

C#

class for the page.  This class will either inherit directly from

System.Web.UI.Page (Beta 2) or if you are using code behind it will 

inherit

directly from your code behind class.  After the class is written, it is

compiled using the command line compiler csc.  Obviously, the result is 

a

.NET assembly which contains MSIL code.  This assembly is then JITted to 

x86

code and cached.  Subsequent requests to the page simply refer to the 

cached

x86 code.



If IIS is restarted, the only compilation that re-occurs for the page is 

the

JIT to x86 code.  The class that ASP.NET writes for the page is not

re-written unless the code changes.  So this step and the compilation to 

a

.NET assembly are skipped.



Hope that further clarifies it for you.



Scott Davis



-----Original Message-----

From: Juan T. Llibre [mailto:j.llibre@c...]

Sent: Monday, April 23, 2001 8:17 AM

To: ASP+

Subject: [aspx] Re: When are ASPX files Recompiled





They are compiled when CALLED for the first time by any browser.



They are recompiled when called by any browser,

after changes have been made to their source code.



The reason your files are recompiled when they are

called after you reboot is, of course, that IIS has been

stopped and restarted by the reboot, so in effect it's as

if they are being called for the first time.



( The IIS application has been stopped and restarted... )



regards,





Juan T. Llibre

Microsoft MVP [IIS/ASP]

ASP.Net En Espa=F1ol : http://207.176.17.140/

http://p2p.wrox.com/subscribe.asp?list=3Daspx_espanol

http://www.asplists.com/asplists/aspnges.asp

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

=3D=3D=3D=3D=3D=3D=3D=3D=3D



----- Original Message -----

From: <kamathamit@p...>

Sent: Monday, April 23, 2001 5:25 AM

Subject: [aspx] When are ASPX files Recompiled





>   From what i have read & seen ASPX files get compiled when they are

> created for the First time or when ever changes are made. It seems to 

me

> that the Files are also recompiled when I Reboot my system!!

>

> Can some one Clarify this?

> Amit



Message #6 by "Juan T. Llibre" <j.llibre@c...> on Mon, 23 Apr 2001 11:49:46 -0500
That sounds quite better...;>)



One point of contention, still, re :



>When the page is requested for the first time,

>ASP.NET will write a VB.NET or C# class that

>inherits from your code behind class.



That is only true for the default installation

of the .NET Framework, which only includes

native support for C++, VB and C#.



You can use quite a few other languages, of which

at least Eiffel and Perl are currently available publicly.



If you are using any other language, the compiler for that

language will generate MSIL but the JIT compiler will not

generate a VB.NET or C# class when the page is called.



It will compile the MSIL to native code.



From the documentation :



<quote>



Microsoft intermediate language (MSIL)

A language used as the output of a number of compilers and as the input to a

just-in-time (JIT) compiler. The runtime includes several JIT compilers for

converting MSIL to native code.



Before Microsoft intermediate language (MSIL) can be executed, it must be

converted by a .NET Framework just-in-time (JIT) compiler to native code.





When compiling to managed code, the compiler translates your source code

into Microsoft intermediate language (MSIL), which is a CPU-independent set

of instructions that can be efficiently converted to native code. MSIL

includes instructions for loading, storing, initializing, and calling

methods on objects, as well as instructions for arithmetic and logical

operations, control flow, direct memory access, and exception handling.



</quote>



regards,





Juan T. Llibre

Microsoft MVP [IIS/ASP]

ASP.Net En Espaņol : http://207.176.17.140/

http://www.asplists.com/asplists/aspnges.asp

http://p2p.wrox.com/scripts/lyris.pl?join=aspx_espanol

ASP en Espaņol : http://aspespanol.com/

===============================



----- Original Message -----

From: "Scott Davis" <Scott.D@e...>

To: "ASP+" <aspx@p...>

Sent: Monday, April 23, 2001 8:40 AM

Subject: [aspx] Re: When are ASPX files Recompiled





Comments in-line

----

>Does that happen even if the page is written in VB ?

>Every page written in VB is compiled to a C# class ?



No, that does happen if the page is written in VB.  Sorry, I should have

mentioned that.  If you are using VB, a VB.NET class will be written by

ASP.NET and compiled using the VB.NET command line compiler.  Everything

else

would still apply.



>I would assume that VB code is compiled by vbc.



You are right.



>The INITIAL compilation ( by the developer ) produces MSIL

>and is done in whichever language the developer chose to write in.



>The JITting occurs when a browser calls the page.



>The JIT compilation should be language-independent

>and is handled by the CLR. Is THAT what you're saying

>is compiled to a C# class ?



The intial compilation that you are talking about only compiles your code

behind VB.NET or C# class down to a .NET assembly (MSIL).  When the page is

requested for the first time, ASP.NET will write a VB.NET or C# class that

inherits from your code behind class.  There are many reasons that this must

be done, but one of the main reasons is that you can still include code in a

<script> block even if you are using code behind.  Any methods that you may

have written in a <script> block would be added to the class that is created

dynamically by ASP.NET.  So in effect, all of the code in your code behind

class is combined with any code in <script> blocks (as well as code in <% %>

tags) into one class and then compiled by the appropriate compiler.  It is

the assembly file resulting from this compilation that is then JITed.



>Also, I assume that recompilation after restart

>only occurs if the page is called, right ?



Right.



Scott Davis



----- Original Message -----

From: "Scott Davis" <Scott.D@e...>

To: "ASP+" <aspx@p...>

Sent: Monday, April 23, 2001 6:54 AM

Subject: [aspx] Re: When are ASPX files Recompiled





There is a slight difference in the re-compile that happens after IIS has

been restarted.



When a page is requested for the first time, ASP.NET actually writes a C#

class for the page.  This class will either inherit directly from

System.Web.UI.Page (Beta 2) or if you are using code behind it will inherit

directly from your code behind class.  After the class is written, it is

compiled using the command line compiler csc.  Obviously, the result is a

.NET assembly which contains MSIL code.  This assembly is then JITted to x86

code and cached.  Subsequent requests to the page simply refer to the cached

x86 code.



If IIS is restarted, the only compilation that re-occurs for the page is the

JIT to x86 code.  The class that ASP.NET writes for the page is not

re-written unless the code changes.  So this step and the compilation to a

.NET assembly are skipped.



Hope that further clarifies it for you.



Scott Davis



-----Original Message-----

From: Juan T. Llibre [mailto:j.llibre@c...]

Sent: Monday, April 23, 2001 8:17 AM

To: ASP+

Subject: [aspx] Re: When are ASPX files Recompiled





They are compiled when CALLED for the first time by any browser.



They are recompiled when called by any browser,

after changes have been made to their source code.



The reason your files are recompiled when they are

called after you reboot is, of course, that IIS has been

stopped and restarted by the reboot, so in effect it's as

if they are being called for the first time.



( The IIS application has been stopped and restarted... )



regards,





Juan T. Llibre

Microsoft MVP [IIS/ASP]

ASP.Net En Espaņol : http://207.176.17.140/

http://p2p.wrox.com/subscribe.asp?list=aspx_espanol

http://www.asplists.com/asplists/aspnges.asp

==================================



----- Original Message -----

From: <kamathamit@p...>

Sent: Monday, April 23, 2001 5:25 AM

Subject: [aspx] When are ASPX files Recompiled





>   From what i have read & seen ASPX files get compiled when they are

> created for the First time or when ever changes are made. It seems to me

> that the Files are also recompiled when I Reboot my system!!

>

> Can some one Clarify this?

> Amit





---

SoftArtisans helps developers build robust, scalable Web applications!

Excel Web reports, charts: http://www.softartisans.com/excelwriter.html

File uploads: http://www.softartisans.com/saf.html

Transactional file management: http://www.softartisans.com/saf1.html

Scalability: http://www.softartisans.com/saxsession.html

ASPstudio value pack: http://www.softartisans.com/aspstudiosuite.html








Message #7 by "Scott Davis" <Scott.D@e...> on Mon, 23 Apr 2001 12:24:47 -0400
Of course, I kind of thought people would get the idea that the 

appropriate

compiler would be used depending on what language you are using.



>If you are using any other language, the compiler for that

>language will generate MSIL but the JIT compiler will not

>generate a VB.NET or C# class when the page is called.



This is somewhat confusing the way you stated it.  The JITer does not 

compile

anything to a particular language class.  It only compiles MSIL, which 

is

language independent to x86 code.



Scott

-----Original Message-----

From: Juan T. Llibre [mailto:j.llibre@c...]

Sent: Monday, April 23, 2001 12:50 PM

To: ASP+

Subject: [aspx] Re: When are ASPX files Recompiled





That sounds quite better...;>)



One point of contention, still, re :



>When the page is requested for the first time,

>ASP.NET will write a VB.NET or C# class that

>inherits from your code behind class.



That is only true for the default installation

of the .NET Framework, which only includes

native support for C++, VB and C#.



You can use quite a few other languages, of which

at least Eiffel and Perl are currently available publicly.



If you are using any other language, the compiler for that

language will generate MSIL but the JIT compiler will not

generate a VB.NET or C# class when the page is called.



It will compile the MSIL to native code.



From the documentation :



<quote>



Microsoft intermediate language (MSIL)

A language used as the output of a number of compilers and as the input 

to a

just-in-time (JIT) compiler. The runtime includes several JIT compilers 

for

converting MSIL to native code.



Before Microsoft intermediate language (MSIL) can be executed, it must 

be

converted by a .NET Framework just-in-time (JIT) compiler to native 

code.





When compiling to managed code, the compiler translates your source code

into Microsoft intermediate language (MSIL), which is a CPU-independent 

set

of instructions that can be efficiently converted to native code. MSIL

includes instructions for loading, storing, initializing, and calling

methods on objects, as well as instructions for arithmetic and logical

operations, control flow, direct memory access, and exception handling.



</quote>



regards,





Juan T. Llibre

Microsoft MVP [IIS/ASP]

ASP.Net En Espa=F1ol : http://207.176.17.140/

http://www.asplists.com/asplists/aspnges.asp

http://p2p.wrox.com/scripts/lyris.pl?join=3Daspx_espanol

ASP en Espa=F1ol : http://aspespanol.com/

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

=3D=3D=3D=3D=3D=3D



----- Original Message -----

From: "Scott Davis" <Scott.D@e...>

To: "ASP+" <aspx@p...>

Sent: Monday, April 23, 2001 8:40 AM

Subject: [aspx] Re: When are ASPX files Recompiled





Comments in-line

----

>Does that happen even if the page is written in VB ?

>Every page written in VB is compiled to a C# class ?



No, that does happen if the page is written in VB.  Sorry, I should have

mentioned that.  If you are using VB, a VB.NET class will be written by

ASP.NET and compiled using the VB.NET command line compiler.  Everything

else

would still apply.



>I would assume that VB code is compiled by vbc.



You are right.



>The INITIAL compilation ( by the developer ) produces MSIL

>and is done in whichever language the developer chose to write in.



>The JITting occurs when a browser calls the page.



>The JIT compilation should be language-independent

>and is handled by the CLR. Is THAT what you're saying

>is compiled to a C# class ?



The intial compilation that you are talking about only compiles your 

code

behind VB.NET or C# class down to a .NET assembly (MSIL).  When the page 

is

requested for the first time, ASP.NET will write a VB.NET or C# class 

that

inherits from your code behind class.  There are many reasons that this 

must

be done, but one of the main reasons is that you can still include code 

in a

<script> block even if you are using code behind.  Any methods that you 

may

have written in a <script> block would be added to the class that is 

created

dynamically by ASP.NET.  So in effect, all of the code in your code 

behind

class is combined with any code in <script> blocks (as well as code in 

<% %>

tags) into one class and then compiled by the appropriate compiler.  It 

is

the assembly file resulting from this compilation that is then JITed.



>Also, I assume that recompilation after restart

>only occurs if the page is called, right ?



Right.



Scott Davis



----- Original Message -----

From: "Scott Davis" <Scott.D@e...>

To: "ASP+" <aspx@p...>

Sent: Monday, April 23, 2001 6:54 AM

Subject: [aspx] Re: When are ASPX files Recompiled





There is a slight difference in the re-compile that happens after IIS 

has

been restarted.



When a page is requested for the first time, ASP.NET actually writes a 

C#

class for the page.  This class will either inherit directly from

System.Web.UI.Page (Beta 2) or if you are using code behind it will 

inherit

directly from your code behind class.  After the class is written, it is

compiled using the command line compiler csc.  Obviously, the result is 

a

.NET assembly which contains MSIL code.  This assembly is then JITted to 

x86

code and cached.  Subsequent requests to the page simply refer to the 

cached

x86 code.



If IIS is restarted, the only compilation that re-occurs for the page is 

the

JIT to x86 code.  The class that ASP.NET writes for the page is not

re-written unless the code changes.  So this step and the compilation to 

a

.NET assembly are skipped.



Hope that further clarifies it for you.



Scott Davis



-----Original Message-----

From: Juan T. Llibre [mailto:j.llibre@c...]

Sent: Monday, April 23, 2001 8:17 AM

To: ASP+

Subject: [aspx] Re: When are ASPX files Recompiled





They are compiled when CALLED for the first time by any browser.



They are recompiled when called by any browser,

after changes have been made to their source code.



The reason your files are recompiled when they are

called after you reboot is, of course, that IIS has been

stopped and restarted by the reboot, so in effect it's as

if they are being called for the first time.



( The IIS application has been stopped and restarted... )



regards,





Juan T. Llibre

Microsoft MVP [IIS/ASP]

ASP.Net En Espa=F1ol : http://207.176.17.140/

http://p2p.wrox.com/subscribe.asp?list=3Daspx_espanol

http://www.asplists.com/asplists/aspnges.asp

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

=3D=3D=3D=3D=3D=3D=3D=3D=3D



----- Original Message -----

From: <kamathamit@p...>

Sent: Monday, April 23, 2001 5:25 AM

Subject: [aspx] When are ASPX files Recompiled





>   From what i have read & seen ASPX files get compiled when they are

> created for the First time or when ever changes are made. It seems to 

me

> that the Files are also recompiled when I Reboot my system!!

>

> Can some one Clarify this?

> Amit



Message #8 by "Juan T. Llibre" <j.llibre@c...> on Mon, 23 Apr 2001 13:30:00 -0500
Scott,



I didn't express it that way. YOU did.



Here's a quote from your message dated

Monday, April 23, 2001 8:40 AM :



>When the page is requested for the first time,

>ASP.NET will write a VB.NET or C# class that

>inherits from your code behind class.



You are referring to this quote from me :

>If you are using any other language, the compiler for that

>language will generate MSIL but the JIT compiler will not

>generate a VB.NET or C# class when the page is called.



That quote is a response to your statement, quoted above.



No problem...



Sometimes getting a point across is fraught

with semantic inconveniences...;>)



regards,





Juan T. Llibre

Microsoft MVP [IIS/ASP]

ASP.Net En Espaņol : http://207.176.17.140/

http://p2p.wrox.com/subscribe.asp?list=aspx_espanol

http://www.asplists.com/asplists/aspnges.asp

==================================

----- Original Message -----

From: "Scott Davis" <Scott.D@e...>

To: "ASP+" <aspx@p...>

Sent: Monday, April 23, 2001 11:24 AM

Subject: [aspx] Re: When are ASPX files Recompiled





Of course, I kind of thought people would get the idea that the appropriate

compiler would be used depending on what language you are using.



>If you are using any other language, the compiler for that

>language will generate MSIL but the JIT compiler will not

>generate a VB.NET or C# class when the page is called.



This is somewhat confusing the way you stated it.  The JITer does not compile

anything to a particular language class.  It only compiles MSIL, which is

language independent to x86 code.



Scott

-----Original Message-----

From: Juan T. Llibre [mailto:j.llibre@c...]

Sent: Monday, April 23, 2001 12:50 PM

To: ASP+

Subject: [aspx] Re: When are ASPX files Recompiled





That sounds quite better...;>)



One point of contention, still, re :



>When the page is requested for the first time,

>ASP.NET will write a VB.NET or C# class that

>inherits from your code behind class.



That is only true for the default installation

of the .NET Framework, which only includes

native support for C++, VB and C#.



You can use quite a few other languages, of which

at least Eiffel and Perl are currently available publicly.



If you are using any other language, the compiler for that

language will generate MSIL but the JIT compiler will not

generate a VB.NET or C# class when the page is called.



It will compile the MSIL to native code.



From the documentation :



<quote>



Microsoft intermediate language (MSIL)

A language used as the output of a number of compilers and as the input to a

just-in-time (JIT) compiler. The runtime includes several JIT compilers for

converting MSIL to native code.



Before Microsoft intermediate language (MSIL) can be executed, it must be

converted by a .NET Framework just-in-time (JIT) compiler to native code.



When compiling to managed code, the compiler translates your source code

into Microsoft intermediate language (MSIL), which is a CPU-independent set

of instructions that can be efficiently converted to native code. MSIL

includes instructions for loading, storing, initializing, and calling

methods on objects, as well as instructions for arithmetic and logical

operations, control flow, direct memory access, and exception handling.



</quote>



regards,





Juan T. Llibre

Microsoft MVP [IIS/ASP]

ASP.Net En Espaņol : http://207.176.17.140/

http://www.asplists.com/asplists/aspnges.asp

http://p2p.wrox.com/scripts/lyris.pl?join=aspx_espanol

ASP en Espaņol : http://aspespanol.com/

===============================



----- Original Message -----

From: "Scott Davis" <Scott.D@e...>

To: "ASP+" <aspx@p...>

Sent: Monday, April 23, 2001 8:40 AM

Subject: [aspx] Re: When are ASPX files Recompiled





Comments in-line

----

>Does that happen even if the page is written in VB ?

>Every page written in VB is compiled to a C# class ?



No, that does happen if the page is written in VB.  Sorry, I should have

mentioned that.  If you are using VB, a VB.NET class will be written by

ASP.NET and compiled using the VB.NET command line compiler.  Everything

else

would still apply.



>I would assume that VB code is compiled by vbc.



You are right.



>The INITIAL compilation ( by the developer ) produces MSIL

>and is done in whichever language the developer chose to write in.



>The JITting occurs when a browser calls the page.



>The JIT compilation should be language-independent

>and is handled by the CLR. Is THAT what you're saying

>is compiled to a C# class ?



The intial compilation that you are talking about only compiles your code

behind VB.NET or C# class down to a .NET assembly (MSIL).  When the page is

requested for the first time, ASP.NET will write a VB.NET or C# class that

inherits from your code behind class.  There are many reasons that this must

be done, but one of the main reasons is that you can still include code in a

<script> block even if you are using code behind.  Any methods that you may

have written in a <script> block would be added to the class that is created

dynamically by ASP.NET.  So in effect, all of the code in your code behind

class is combined with any code in <script> blocks (as well as code in <% %>

tags) into one class and then compiled by the appropriate compiler.  It is

the assembly file resulting from this compilation that is then JITed.



>Also, I assume that recompilation after restart

>only occurs if the page is called, right ?



Right.



Scott Davis



----- Original Message -----

From: "Scott Davis" <Scott.D@e...>

To: "ASP+" <aspx@p...>

Sent: Monday, April 23, 2001 6:54 AM

Subject: [aspx] Re: When are ASPX files Recompiled





There is a slight difference in the re-compile that happens after IIS has

been restarted.



When a page is requested for the first time, ASP.NET actually writes a C#

class for the page.  This class will either inherit directly from

System.Web.UI.Page (Beta 2) or if you are using code behind it will inherit

directly from your code behind class.  After the class is written, it is

compiled using the command line compiler csc.  Obviously, the result is a

.NET assembly which contains MSIL code.  This assembly is then JITted to x86

code and cached.  Subsequent requests to the page simply refer to the cached

x86 code.



If IIS is restarted, the only compilation that re-occurs for the page is the

JIT to x86 code.  The class that ASP.NET writes for the page is not

re-written unless the code changes.  So this step and the compilation to a

.NET assembly are skipped.



Hope that further clarifies it for you.



Scott Davis



-----Original Message-----

From: Juan T. Llibre [mailto:j.llibre@c...]

Sent: Monday, April 23, 2001 8:17 AM

To: ASP+

Subject: [aspx] Re: When are ASPX files Recompiled





They are compiled when CALLED for the first time by any browser.



They are recompiled when called by any browser,

after changes have been made to their source code.



The reason your files are recompiled when they are

called after you reboot is, of course, that IIS has been

stopped and restarted by the reboot, so in effect it's as

if they are being called for the first time.



( The IIS application has been stopped and restarted... )



regards,





Juan T. Llibre

Microsoft MVP [IIS/ASP]

ASP.Net En Espaņol : http://207.176.17.140/

http://p2p.wrox.com/subscribe.asp?list=aspx_espanol

http://www.asplists.com/asplists/aspnges.asp

==================================



----- Original Message -----

From: <kamathamit@p...>

Sent: Monday, April 23, 2001 5:25 AM

Subject: [aspx] When are ASPX files Recompiled





>   From what i have read & seen ASPX files get compiled when they are

> created for the First time or when ever changes are made. It seems to me

> that the Files are also recompiled when I Reboot my system!!

>

> Can some one Clarify this?

> Amit





---

SoftArtisans helps developers build robust, scalable Web applications!

Excel Web reports, charts: http://www.softartisans.com/excelwriter.html

File uploads: http://www.softartisans.com/saf.html

Transactional file management: http://www.softartisans.com/saf1.html

Scalability: http://www.softartisans.com/saxsession.html

ASPstudio value pack: http://www.softartisans.com/aspstudiosuite.html








Message #9 by "Scott Davis" <Scott.D@e...> on Mon, 23 Apr 2001 13:36:11 -0400
Sorry, I missed the NOT in your original statement.



The only thing I originally wanted to point out was that when IIS is

restarted, ASP.NET does not re-create the generated class and compile it 

to a

.NET assembly (MSIL).  The .NET assembly that is created the first time 

the

page is requested is persisted to disk in the 'Temporary ASP.NET Files'

folder (The location is configurable per application).  When IIS is

restarted, it will simply JIT this assembly and cache the x86 code.  So 

the

compilation steps that are performed when the code on a page is changed

and/or requested for the first time, are different from the compliation 

steps

performed when IIS is restarted (ie...There is less work to do after an 

IIS

restart).



Scott Davis



-----Original Message-----

From: Juan T. Llibre [mailto:j.llibre@c...]

Sent: Monday, April 23, 2001 2:30 PM

To: ASP+

Subject: [aspx] Re: When are ASPX files Recompiled





Scott,



I didn't express it that way. YOU did.



Here's a quote from your message dated

Monday, April 23, 2001 8:40 AM :



>When the page is requested for the first time,

>ASP.NET will write a VB.NET or C# class that

>inherits from your code behind class.



You are referring to this quote from me :

>If you are using any other language, the compiler for that

>language will generate MSIL but the JIT compiler will not

>generate a VB.NET or C# class when the page is called.



That quote is a response to your statement, quoted above.



No problem...



Sometimes getting a point across is fraught

with semantic inconveniences...;>)



regards,





Juan T. Llibre

Microsoft MVP [IIS/ASP]

ASP.Net En Espa=F1ol : http://207.176.17.140/

http://p2p.wrox.com/subscribe.asp?list=3Daspx_espanol

http://www.asplists.com/asplists/aspnges.asp

Message #10 by kamathamit@p... on Sat, 28 Apr 2001 07:57:34
Hi,



  Thanks for the Explination!. Just one more thing

  You have written

> The .NET assembly that is created the first time the

> page is requested is persisted to disk in the 'Temporary ASP.NET Files'

> folder (The location is configurable per application).  



 Can u please tell me how do i configure the Loction.



Amit

   



> Sorry, I missed the NOT in your original statement.

> 

> The only thing I originally wanted to point out was that when IIS is

> restarted, ASP.NET does not re-create the generated class and compile it 



> to a

> .NET assembly (MSIL).  The .NET assembly that is created the first time 

> the

> page is requested is persisted to disk in the 'Temporary ASP.NET Files'

> folder (The location is configurable per application).  When IIS is

> restarted, it will simply JIT this assembly and cache the x86 code.  So 

> the

> compilation steps that are performed when the code on a page is changed

> and/or requested for the first time, are different from the compliation 

> steps

> performed when IIS is restarted (ie...There is less work to do after an 

> IIS

> restart).

> 

> Scott Davis

> 


  Return to Index