Application without global.asax

C

Colin

Hi altogether,

I ran into a problem with asp.net:

I tried to create a pure web application WITHOUT any asax or aspx
pages. Only one .dll in the bin folder supplying a HttpApplication and
some IHttpModules etc.. All pages are created dynamicly using a xml
data source and converting through xslt.

Now I have the problem, that asp.net does not start my HttpApplication
(how could it? it can't even know which class to use :( ).
web.config isn't very helpful either, you cannot specify your
httpapplication to use and using the global.asax really annoys me!

Is there any way to solve this problem elegant? Btw. could somebody
explain to me how asp chooses the .dll in the bin folder? Does it load
all of them and then decides wich too take?

Most pages around the asp.net deployment only explain "Create a new
Http Application in VS" or "xcopy - the new tool, written for asp.net
deployment" :)).

One last question comes to mind - why does asp.net compile the aspx
pages at every first page access per session? Wouldn't a caching of
the compiled files be a lot more effective? (maybe i haven't found the
right setting to enable this ;)

Thanks,

Colin
 
M

Max

I'm fairly new to ASP.NET, but I believe I'm giving the correct response:

Colin said:
I tried to create a pure web application WITHOUT any asax or aspx
pages. Only one .dll in the bin folder supplying a HttpApplication and
some IHttpModules etc.. All pages are created dynamicly using a xml
data source and converting through xslt.

ASP.NET is nothing more than an ISAPI DLL running as an IIS "plug-in." As
you know, IIS basically just routes the HTTP request to the appropriate
ISAPI DLL, and then gets the response from that DLL and shoots it off as an
HTTP request.

The aspx or asmx pages are the only way I know of to initiate an HTTP
request in IIS. The pages tell IIS that it should use the .NET engine,
instead of say the ASP engine, which is another ISAPI DLL. ISAPI DLL's are
just multithreaded COM DLL's that you can write in Visual C++.

One last question comes to mind - why does asp.net compile the aspx
pages at every first page access per session? Wouldn't a caching of
the compiled files be a lot more effective? (maybe i haven't found the
right setting to enable this ;)

When an ASP.NET application compiles on first access, it also creates a
thread in memory. When no one is using the application, it removes it from
memory. If you only get 1 hit every 30 minutes, which is very odd, well then
your app will hang while it compiles. There is no way to change this. The
app must be hit to keep it alive.

This is actually very common in software. Every app takes time to load. If
you use it frequently, you keep it in memory.

-Max
 
A

Alvin Bruney

hmmm, you going the long way around here. but i'll assume you have a
excellent reason for this effort.

Without the application file, your application cannot respond to any
application level events raised by asp.net or by httpmodules. If you are
going to build out your own pages manually, you still need a way to point
Asp.NET to the target assembly which is the job of the global.asax file.

Also to note, you are dropping a whole bunch of functionality which are
implemented automatically for you by the framework. In the absence of these,
you will have to build your own to ensure that your application is
well-behaved. I'm not sure why the application file is causing you enough
heartache that you want to subvert the mechanism.

The files are cached, but to cache you must have a file. Upon initial
request, there is no compiled class so Asp.Net compiles one and uses it,
caching a copy of it for as long as it remains valid - validity of the class
being determined by a number of facters such as time stamp etc.

hth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top