473,385 Members | 1,780 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Precompile Contradiction?

Scenario:

ASP .NET 2.0 Web "Site"
All but one page is written using inline VB .NET code.
One page is written using VB .NET code-behind.
MSBuild options are set at the default (allow pages to be updateable)

When I "publish" the site and take a look at the precompiled folder that is
generated by this process, I see a /bin folder has been created with one
file in it "App_Web_pccpykfu.dll".
I also see a new file: "PrecompiledApp.config" in the site root.
When I open up one of the .aspx files, I still see my VB .NET source code.
I did a little snooping in the MSDN help and found this:
(From:
ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_vwdcon/html/c8048c31-012b-4718-b8ac-06a2dd41c137.htm)
"For precompiled sites that can be updated, the code in single-file pages is
not compiled into an assembly, but is instead deployed as source code."

So, here are my questions:

What is this "App_Web_pccpykfu.dll" file in my \bin folder?
What is the "PrecompiledApp.config" file in the site root?
Because I still see my source code in the inline .aspx files and because of
the snippet above I found in the help, does it mean that inline .aspx pages
set to be updateable will not actually be precompiled at all (since I don't
see any assemblies for the web pages - I was expecting one per page)?

Thanks,

Scott

Nov 22 '07 #1
3 1995
Hello Scott,

In your message, you're asking some questions about the ASP.NET 2.0
precompilation model. I think we can clarify these questions by two steps:

1.Get how the ASP.NET 2.0 compile the pages at runtime(suppose you do not
precompile it)

2.What's the usage of different precompile model and what's the usage of
those generated procompile files and assemblies
1) So start from the 1st:

Suppose you do not perform precompilation, ASP.NET runtime will do the
following when you visit an aspx page the first time(leave both aspx and
codebehind source file unprecompiled):

** it first dynamically compile the codebehind file, and due to batch
compile model, it may compile a group of pages(and other referenced stuffs,
such as the one in App_code) together and generate assemblies.
**After the codegbehind class has been generated, a second class will be
generated, this class come from the aspx template and it derive from the
class generated from code behind.

** Finally, asp.net runtime will create the instance of the second class
for page instance.

Here is a web article which also introduce this page inheritance model:

#Understanding Page Inheritance in ASP.NET 2.0
http://west-wind.com/weblog/posts/3016.aspx

2)So for the VS 2005/ASP.NET 2.0's precompilation process(you do it through
VS 2005 or commandline tool), it has two models, "updatable" and
"nonupdatable"

**for "updatable", it only precompile the codebehind class into assembly
and still leave the aspx template so that you can change it after
precompilation(deploy). So at runtime, the second dynamic page class still
need to be generated on-demand dynamically

**for "nonupdatable", it will generate both the two dynamic generated
classes I mentioned above.

So now, have you got why there is also "xxx.dll" generated even you choose
"updatable" mode that do not precompile the aspx file?

In addition, for the "Precompile.config" file you mentioned, it is a xml
file, open it, you'll find those xml content actually indicate the
following information:

## [page url] aspx page's template and assembly has been precompiled into
[assembly name] assembly

Thus, at runtime, ASP.NET engine knows where it should locate the correct
page class/handler for a certain request path(since original aspx page may
have been precompiled and doesn't contains class/assembly info at all).

Hope this helps clarify the problem some.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

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

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
>Reply-To: "Scott M." <sm**@nospam.nospam>
From: "Scott M." <sm**@nospam.nospam>
Subject: Precompile Contradiction?
Date: Wed, 21 Nov 2007 23:31:33 -0500
Scenario:

ASP .NET 2.0 Web "Site"
All but one page is written using inline VB .NET code.
One page is written using VB .NET code-behind.
MSBuild options are set at the default (allow pages to be updateable)

When I "publish" the site and take a look at the precompiled folder that
is
>generated by this process, I see a /bin folder has been created with one
file in it "App_Web_pccpykfu.dll".
I also see a new file: "PrecompiledApp.config" in the site root.
When I open up one of the .aspx files, I still see my VB .NET source code.
I did a little snooping in the MSDN help and found this:
(From:
ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_vwdcon/html/c80
48c31-012b-4718-b8ac-06a2dd41c137.htm)
>"For precompiled sites that can be updated, the code in single-file pages
is
>not compiled into an assembly, but is instead deployed as source code."

So, here are my questions:

What is this "App_Web_pccpykfu.dll" file in my \bin folder?
What is the "PrecompiledApp.config" file in the site root?
Because I still see my source code in the inline .aspx files and because
of
>the snippet above I found in the help, does it mean that inline .aspx
pages
>set to be updateable will not actually be precompiled at all (since I
don't
>see any assemblies for the web pages - I was expecting one per page)?

Thanks,

Scott

Nov 22 '07 #2
Hi Steven,

A couple of thoughts on this...

So, when NOT using a code-behind, based on what you wrote:
**for "updatable", it only precompile the codebehind class into assembly
and still leave the aspx template so that you can change it after
precompilation(deploy). So at runtime, the second dynamic page class still
need to be generated on-demand dynamically
Then it would seem that Publish does NOT do a precomplie in this case
(because of the fact that the code that would need compliling is located in
the .aspx file that has been marked as being updateable). This was my
original assertion. - True?

I did surmize that the one assembly I did have that was found in my /bin
folder was for the one code-behind page in the site.

-Scott
"Steven Cheng[MSFT]" <st*****@online.microsoft.comwrote in message
news:SP**************@TK2MSFTNGHUB02.phx.gbl...
Hello Scott,

In your message, you're asking some questions about the ASP.NET 2.0
precompilation model. I think we can clarify these questions by two steps:

1.Get how the ASP.NET 2.0 compile the pages at runtime(suppose you do not
precompile it)

2.What's the usage of different precompile model and what's the usage of
those generated procompile files and assemblies
1) So start from the 1st:

Suppose you do not perform precompilation, ASP.NET runtime will do the
following when you visit an aspx page the first time(leave both aspx and
codebehind source file unprecompiled):

** it first dynamically compile the codebehind file, and due to batch
compile model, it may compile a group of pages(and other referenced
stuffs,
such as the one in App_code) together and generate assemblies.
**After the codegbehind class has been generated, a second class will be
generated, this class come from the aspx template and it derive from the
class generated from code behind.

** Finally, asp.net runtime will create the instance of the second class
for page instance.

Here is a web article which also introduce this page inheritance model:

#Understanding Page Inheritance in ASP.NET 2.0
http://west-wind.com/weblog/posts/3016.aspx

2)So for the VS 2005/ASP.NET 2.0's precompilation process(you do it
through
VS 2005 or commandline tool), it has two models, "updatable" and
"nonupdatable"

**for "updatable", it only precompile the codebehind class into assembly
and still leave the aspx template so that you can change it after
precompilation(deploy). So at runtime, the second dynamic page class still
need to be generated on-demand dynamically

**for "nonupdatable", it will generate both the two dynamic generated
classes I mentioned above.

So now, have you got why there is also "xxx.dll" generated even you choose
"updatable" mode that do not precompile the aspx file?

In addition, for the "Precompile.config" file you mentioned, it is a xml
file, open it, you'll find those xml content actually indicate the
following information:

## [page url] aspx page's template and assembly has been precompiled into
[assembly name] assembly

Thus, at runtime, ASP.NET engine knows where it should locate the correct
page class/handler for a certain request path(since original aspx page may
have been precompiled and doesn't contains class/assembly info at all).

Hope this helps clarify the problem some.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

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

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.


--------------------
>>Reply-To: "Scott M." <sm**@nospam.nospam>
From: "Scott M." <sm**@nospam.nospam>
Subject: Precompile Contradiction?
Date: Wed, 21 Nov 2007 23:31:33 -0500
Scenario:

ASP .NET 2.0 Web "Site"
All but one page is written using inline VB .NET code.
One page is written using VB .NET code-behind.
MSBuild options are set at the default (allow pages to be updateable)

When I "publish" the site and take a look at the precompiled folder that
is
>>generated by this process, I see a /bin folder has been created with one
file in it "App_Web_pccpykfu.dll".
I also see a new file: "PrecompiledApp.config" in the site root.
When I open up one of the .aspx files, I still see my VB .NET source code.
I did a little snooping in the MSDN help and found this:
(From:
ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_vwdcon/html/c80
48c31-012b-4718-b8ac-06a2dd41c137.htm)
>>"For precompiled sites that can be updated, the code in single-file pages
is
>>not compiled into an assembly, but is instead deployed as source code."

So, here are my questions:

What is this "App_Web_pccpykfu.dll" file in my \bin folder?
What is the "PrecompiledApp.config" file in the site root?
Because I still see my source code in the inline .aspx files and because
of
>>the snippet above I found in the help, does it mean that inline .aspx
pages
>>set to be updateable will not actually be precompiled at all (since I
don't
>>see any assemblies for the web pages - I was expecting one per page)?

Thanks,

Scott

Nov 22 '07 #3
Thanks for your reply Scott,

================
Then it would seem that Publish does NOT do a precomplie in this case
(because of the fact that the code that would need compliling is located in
the .aspx file that has been marked as being updateable). This was my
original assertion. - True?
=====================

Yes, when you select "updatable" precompile mode(publish site), for those
pages that do not use codebehind(separate code out of aspx file),
precompile won't generate page class(or assembly) for those particular
pages. Actually, you can do a simple test to verify this. If there is only
non-codebehind aspx pages in project and you publish it as "updatable", bin
dir will be empty(if no other stuffs such as App_Code codes will be
precompiled).

If you have any further questions on this, welcome to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

---------------
----
>Reply-To: "Scott M." <sm**@nospam.nospam>
From: "Scott M." <sm**@nospam.nospam>
References: <32**********************************@microsoft.co m>
<SP**************@TK2MSFTNGHUB02.phx.gbl>
>In-Reply-To: <SP**************@TK2MSFTNGHUB02.phx.gbl>
Subject: Re: Precompile Contradiction?
Date: Thu, 22 Nov 2007 10:04:18 -0500
>
Hi Steven,

A couple of thoughts on this...

So, when NOT using a code-behind, based on what you wrote:
>**for "updatable", it only precompile the codebehind class into assembly
and still leave the aspx template so that you can change it after
precompilation(deploy). So at runtime, the second dynamic page class
still
>need to be generated on-demand dynamically

Then it would seem that Publish does NOT do a precomplie in this case
(because of the fact that the code that would need compliling is located
in
>the .aspx file that has been marked as being updateable). This was my
original assertion. - True?

I did surmize that the one assembly I did have that was found in my /bin
folder was for the one code-behind page in the site.

-Scott
Nov 23 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Abelardo Vacca | last post by:
Hello, I am currently in the process of switching our application to a N-Tier model with .NET. One of the aspects we want ot get right from the start not to worry about it after is the...
0
by: Bernard Dhooghe | last post by:
DB2 UDB V8.1 Fixpak 4 AIX 5.1 CLASSPATH: /usr/opt/db2_08_01/java/db2jcc.jar:/usr/opt/db2_08_01/java/db2jcc_license_cu.jar:/usr/opt/db2_08_01/java/sqlj.zip:/usr/java131/jre/lib/rt.jar: Program:...
1
by: Steve Franks | last post by:
Hi - I'm using VS.NET 2005 and have read about this precompile.axd that supposedly can be hit with a browser to force a complete recompile on the production server. However I do not have this .axd...
8
by: Mike Owen | last post by:
Hi, I am trying to pre-compile a project prior using ASP.Net 2.0, VS 2005, to putting it onto a live server. The reason for doing this is that other people have access to the server, and I...
12
by: Joe Abou Jaoude | last post by:
hi, I have a component that uses a database connection. In the finalizer I dispose the connection because I read in msdn the following: "A type must implement Finalize when it uses...
2
by: Shimon Sim | last post by:
I tried to use Precompile.axd to compile my site but got HTTP404 (The resource cannot be found) instead. I am running ASP.NET Version:2.0.50727.42 .. Any suggestions? Thank you, Shimon.
1
by: Tessa | last post by:
Hi, Is there a way to use aspnet_compiler to precompile an existing asp.net 2.0 web application that is on another server? I need to initiate the precompile programmatically from another .net...
7
by: bruce barker | last post by:
a previous long thread brought this up. I can find no way to precompile a web application from visual studio. by precompile I mean all the aspx code is converted to assemblies by visual studio,...
1
by: Gabriel Pineda | last post by:
hi everybody, i have an issue for you: i have an operative site wich i'm trying to precompile to protect the code that will be installed on client. the issue is: if i run the precompile...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.