Re: ASP .NET 2.0 Unanswered questions...
- From: bruce barker <nospam@xxxxxxxxxx>
- Date: Sun, 14 Oct 2007 21:17:28 -0700
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
- Follow-Ups:
- Re: ASP .NET 2.0 Unanswered questions...
- From: Scott M.
- Re: ASP .NET 2.0 Unanswered questions...
- References:
- Re: ASP .NET 2.0 Unanswered questions...
- From: bruce barker
- Re: ASP .NET 2.0 Unanswered questions...
- From: Rory Becker
- Re: ASP .NET 2.0 Unanswered questions...
- Prev by Date: RE: Web parts and ASP.Net Futures July
- Next by Date: Re: scrolling column in a table
- Previous by thread: Re: ASP .NET 2.0 Unanswered questions...
- Next by thread: Re: ASP .NET 2.0 Unanswered questions...
- Index(es):
Relevant Pages
|