Re: automatic namespace importing

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Natan (nvivo_at_mandic.com.br)
Date: 12/17/04


Date: Fri, 17 Dec 2004 09:11:50 -0200

Juan T. Llibre [MVP] wrote:
> I think we may be nearer to narrowing down
> what is happening here.

> That generated output is *not* the result of parsing and compiling
> the page by ASP.NET, but the result of the csc.exe compiler
> compiling the page, just as it would have been the result of the
> vbc.exe compiler, if VB had been the language declared in the page.

Ok. Now think in what you said. Does it really make sense? "lets include
an html parser in the C# compiler"... i don't think so.

Yes, CSC compiles the code, but doesn't generates this class from html.
This is because it is specific to ASP.NET how it parses the page and
creates the class. CSC's job is just to compile C# code, nothing more.

There are some classes in .NET that generates code from xml, and this is
probaly generated by them. But who parses the html and generates the
input to this tool is ASP.NET. Because ASP.NET is responsible for this,
not CSC.

> I have quite an interesting .NET/ASP.NET setup, because I'm running
> Windows Server 2003, which includes .Net Framework 1.1 "out of the box",
> which means I didn't have to install it.

Yes, because Win2003 comes with .NET 1.1.

> I afterwards installed VS.NET 2005, which installed .Net Framework 2.0.
>
> Here's the interesting thing :
>
> I've *never* compiled any .NET 1.1.4322.2032 projects
> ( like for example, the ASP.NET Forums... ) with VS.NET 2005.

1.1.4322.2032 is the version of .NET 1.1 SP1, not VS.NET 2005.

> Here's the key:
>
> I did a search for source files ( .vb or .cs ) of the type which have the
> "This code was generated by a tool" disclaimer, in the "Temporary
> ASP.NET files"
> folder, and *only* found files generated by VS.NET 2005 with this
> disclaimer :
>
> "This code was generated by a tool.
> Runtime Version:2.0.40607.16"

So, here we go. Please, forget about VS.NET. .NET doesn't depend on
VS.NET to work. It is just a tool to help you create applications.

You got this because you installed .NET 2.0. After installing it, all
your asp.net pages are compiled with .net 2.0. You can change this in
your website properties in IIS.

> I did *not* find any files with the disclaimer for "Runtime Version
> 1.1.4322.2032",
> even though they were equally processed by ASP.NET.

Because it is processed by .NET 2.0 =)

> This leads to the inescapable conclusion that it is *not*
> ASP.NET which is compiling the .aspx files, as you claim,
> and that it *is* the underlying compiler ( csc.exe or vbc.exe )
> which is doing the compiling, the results of which *then* are
> processed by aspnet_isapi.dll.

I can't understand how you got to this conclusion. "the numer is 2, not
1.. so csc is an html parser". this doesn't make sense.

What you discovered is that your code is generated by a different
version of the same tool, but you didn't see anything telling that csc
is parsin html pages.

When I tell you ASP.NET parses the page to generate the class, the real
process probably involves lots of classes in Microsoft.CSharp too. But
the one who parses the html and tell how to create the class is ASP.NET.
That is why you have System.Web.Compilation...

> No. The aspx page is compiled by either csc.exe or vbc.exe,
> depending on the language declared for the page, and ASP.NET
> ( aspnet_isapi.dll ) has nothing to do with the code until it processes
> the MSIL generated by the appropiate compiler.

Of course it is compiled by csc. But not generated. That is why csc is
called "c sharp compiler" not "asp.net html parser".

Take a loot at this and this is probably how things work.
http://myxaml.com/marcclifton/archive/2004/04/21/223.aspx

so asp.net generates common input to some parser which given an language
type generates the real output. csc only compiles it.

[Tired...]



Relevant Pages

  • Re: FSO Issues with Unicode
    ... support in the HTML Help Compiler was to change the meta tag to UTF-8. ... Have you found an example of a CHM file that was done in Unicode? ...
    (microsoft.public.scripting.vbscript)
  • Re: automatic namespace importing
    ... Generation of a *.cs or .vb file holding code that matches the ASPX declarations. ... or using of vbc.exe (VB.NET compiler) to compile *.vb file into DLL ... > Yes, CSC compiles the code, but doesn't generates this class from html. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Stack trace terminated abnormally using IVF and NT-MPICH
    ... incluing one for the Intel compiler. ... Have the calling mechanisms changed from the Intel 7.x compilers to the IVF ... >>message in html mode but apparently I could not remove all the tags. ...
    (comp.lang.fortran)
  • 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)
  • Re: What is the learning curve for PHP?
    ... HTML properly either. ... HTML is an interpreted langauge that has a simple method of handling ... but isn't militant about making you use it like Java is. ... and secondly the compiler by gcc is has ...
    (comp.lang.php)