473,652 Members | 3,123 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_pccpyk fu.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.ht m)
"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_pccpyk fu.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 2008
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
"nonupdatab le"

**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 "nonupdatab le", 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.con fig" 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.no spam>
From: "Scott M." <sm**@nospam.no spam>
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_pccpyk fu.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.ht m)
>"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_pccpyk fu.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.comw rote in message
news:SP******** ******@TK2MSFTN GHUB02.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
"nonupdatab le"

**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 "nonupdatab le", 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.con fig" 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.no spam>
From: "Scott M." <sm**@nospam.no spam>
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_pccpyk fu.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.ht m)
>>"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_pccpyk fu.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(sepa rate 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.no spam>
From: "Scott M." <sm**@nospam.no spam>
References: <32************ *************** *******@microso ft.com>
<SP************ **@TK2MSFTNGHUB 02.phx.gbl>
>In-Reply-To: <SP************ **@TK2MSFTNGHUB 02.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
1846
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 Exception management. I have read two MSDN documents that appear to be in contradiction, and I would like to know if someone can explain to me which of the two is the
0
1518
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: tmp0.sqlj import java.sql.*; import sqlj.runtime.*; import sqlj.runtime.ref.*;
1
1714
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 file. Where can I get it and how is it installed? Also what is to prevent an outside users from hitting this a bunch of times on purpose? Steve
8
1524
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 thereofre want to keep the code secure. If I use the 'Build/Publish Web Site' option, it asks me to tell it the 'Target location' which in this case is 'C:\Temp\PrecompiledWeb\Project1'
12
2109
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 unmanaged resources such as file handles or database connections that must be released when the managed object that uses them is reclaimed."
2
1796
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
1739
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 windows program running on a different machine. thanks for any info
7
3116
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, not at runtime by asp.net. if you view the compiled aspx page it should only contain the line: This is a marker file generated by the precompilation tool, and should not be deleted!
1
171
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 (aspnet_compiler) it throw me some errors: ex: Name 'CN' is not declared. this is because the variable es declared in another page, that includes the one which throw the error. how can i bypass these "errors" ? how can i precompile the site? is it...
0
8811
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8703
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8467
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8589
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6160
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5619
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4291
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2703
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1914
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.