Re: ASP .NET 2.0 Unanswered questions...



in both 1.1 and 2.0 there are two types of source files. code behind usually written in c# or vb, and asp.net source files.

version 1.1 of asp.net in order to support inline server script (or asp.net codebehind with no visual studio support), generated source code for the page, then called the desired compiler to build a dll. this was done on the first request to the page. the source file was produced in a temp folder (and an actual compiler script), and after being built the assembly was loaded into memory. this also required all dll's in the bin folder be copied to the temp. a visual studio project would build the codebe

in version 2.0, because of partial classes, the aspnet_compiler converts aspx pages to il directly, (actually so did 1.1, but it used the .net codedom library to convert il to source code). version 2.0 has a bunch of compiler options, (if you look in your msbuild scripts you can see the aspnet_compiler options you are using). you shoudl read the apnet_compiler documentation to get an idea of how it works.

you can also look in your deployment project. if the aspx pages are all empty (no source) then your site was precompiled for all the aspx pages and has been batched into dll's (again depending on compiler switches). if they contain source code, then they will be compiled at runtime on first page request much like 1.1

again in version 2.0 the only difference between web sites and web application is the handling of the code behind files compilation (whether the aspnet_compiler call the language compiler or msbuild) and in the case of a web applications the existence of a project file. there is no difference in how the aspx pages are compiled.

in either case you should use deployment projects to build a deployment folder.

even if you use only notepad, and the aspnet_compiler, to build a production web site, you can get the same results as visual studio.

again the main benefit of web applications (to the developer) is not having to define formal interfaces in the app_code folder for pages to call each other (this is what broke most 1.1 apps trying to move to 2.0 and drove MS to release web application projects).

i personally feel defining interfaces is a better practice (see interface design pattern), but it is more work.

in any case disk space is cheap and you shouldn't worry too much about how many dlls are produced.

ps. looking in vs2008, with a web application i can see no way with visual studio to do a full precompile of the aspx pages like you can with a website. you could still update the msbuild file manually to do it though. i'll check with vs2005 when i get chance to see if it has the same limitation.



-- bruce (sqlwork.com)






Rory Becker wrote:
Bruce....

...can you point to any references to back this up?

Whilst I am interested in all versions of ASP.Net, I would be very interested for you to provide a reference which suggests that an ASP.Net 1.1 application produces 1 assembly per page as I do not believe this is the case.

Likewise I have not seen this behaviour for ASP.Net 2.0 "Web Applications"

All shadow copied assemblies appear to be literally copies of those found in a Bin directory of the Web Applications source.

Also I believe that with the exception of NGen (whose native images are ignored by ASP.Net 1.1 anyway.) Jit compiling does not produce further assemblies as it is an in-memory process only.
Thanks
--
Rory



.



Relevant Pages

  • Re: SHMENUBARINFO not defined says compiler - aygshell.h defined
    ... group that supports the SDK for the desktop. ... After I add "/c" to the compiler options, i get the following and i have no ... which is used when compiling the source files. ... > Microsoft Mobile and Embedded Devices Developer Support ...
    (microsoft.public.pocketpc.developer)
  • Request for feedback: proposed new modules to aid VHDL projects
    ... Performs a minimal recompile of a VHDL project using ModelSim, ... only those design units which have changed, and those which depend on them. ... * Feeds source files through a preprocessor if wanted (preprocessors are ... References any compiler errors back to the correct source file and line ...
    (comp.lang.perl.modules)
  • Request for feedback: proposed new Perl modules to aid VHDL projects
    ... Performs a minimal recompile of a VHDL project using ModelSim, ... only those design units which have changed, and those which depend on them. ... * Feeds source files through a preprocessor if wanted (preprocessors are ... References any compiler errors back to the correct source file and line ...
    (comp.lang.vhdl)
  • Re: C++ Project Files?????
    ... The C preprocessor *merges* the header files with the source files ... > What the is a library file? ... > files have been turned into object files, ... that came with your compiler. ...
    (comp.lang.cpp)
  • Re: Parsing an html/aspx file
    ... Compiling the ASPX and using reflection I guess that's one way to use the ... may have to play around with some compiler settings. ... I did say it would be another matter if the HTML is not well formed. ... .net parses asp.net files by looking for well formed asp.net ...
    (microsoft.public.dotnet.framework.aspnet)