aspnet_regiis and script maps in IIS

J

Jeremy S.

In IIS 6.0, what are the "script maps" in IIS, as described in the
documentation for aspnet_regiis.exe?

http://msdn.microsoft.com/en-us/library/k6h9cz8h(VS.80).aspx

For the -i switch, the documentation states: "updates the script maps at the
IIS metabase root and below."

Are these script maps where IIS maps file name extensions to particular
isapi ddls?

For example, .aspx maps to
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll

Is the above what is meant as "script map"? If that's not a script map, then
what is?

Thanks
 
J

Juan T. Llibre

re:
!> what are the "script maps" in IIS

Script mapping is the mechanism to map the .ASPX file extension
to a specific Web application and to a version of the .NET Framework.

To check the current script map configuration, run :

aspnet_regiis –lk

That command will return the version of ASP.NET
that owns the different script map configurations.





===============
 
J

Jeremy S.

<snip>

Juan T. Llibre said:
re:
!> what are the "script maps" in IIS

Script mapping is the mechanism to map the .ASPX file extension
to a specific Web application and to a version of the .NET Framework.

To check the current script map configuration, run :

aspnet_regiis -lk

That command will return the version of ASP.NET
that owns the different script map configurations.


Okay - so what's a script map? I guess my question is really basic.
Apparently a "script map" is not what I thought it was - but I still don't
know what it is.

Thanks
 
K

Ken Schaefer

Hi,

What you posted originally is correct. ASP.NET is implemented as an ISAPI
Extension (prior to IIS 7.0 anyway). The way that we get ASP.NET involved
when a request comes in, is by configuring a "script mapping". This maps a
particular file extension (e.g. .aspx) to a particular ISAPI Extension
(ASP.NET - aspnet_isapi.dll). The extension is passed the request for
processing after it has passed through the initial IIS pipeline.

Cheers
Ken
 
J

Jeremy S.

Thanks Ken. Your explanation was helpful. I pretty much know how IIS and
ASP.NET hang together, I was just not clear on the particular vocabulary -
"script map". Now I know.

- J
 
J

Juan T. Llibre

re:
!>> Script mapping is the mechanism to map the .ASPX file extension
!>> to a specific Web application and to a version of the .NET Framework.
!>> That command will return the version of ASP.NET
!>> that owns the different script map configurations.

!> Okay - so what's a script map? I guess my question is really basic.

..ASPX files are server scripts.

The linking of .aspx files so that they are processed by a particular
instance of the .Net Framework is called "script mapping", i.e.,
the "mapping" of a type of file extension to a .Net Framework version
so that only *that* .Net version process the file.

For example, I have mapped the .juan extension to ASP.NET version 2.0.50727:

http://asp.net.do/test/version.juan

To do that, I "mapped" the .juan extension to
drive:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll
in the IIS Manager ( select an application, select its properties and click
the "configuration" button ). Look at examples there and add your extension.

I also added the following to web.config :

<httpHandlers>
<add verb="*" path="*.juan" type="System.Web.UI.PageHandlerFactory"/>
</httpHandlers>

<compilation debug="true">
<buildProviders>
<add extension=".juan" type="System.Web.Compilation.PageBuildProvider" />
</buildProviders>
</compilation>

That's it...

Now I can use files with the extension ".juan" as if they were .aspx files.



===============
 
J

Jeremy S.

<Snip, snip snip snip>

RE:
<< .ASPX files are server scripts. >>

This is exactly where I missed the train. I have always understood .aspx
files as full-blown *classes* serialized to disk in a text file with a .aspx
extension... but that's from the perspective of the .NET Framework. The aspx
inherits it's code-behind, which in turn typically inherits Page. I guess
it's from the perspective of IIS that these are *scripts*. In any case it's
now clarified.

Thanks! very helpful with the complete example.
 
K

Ken Schaefer

Technically script mapping has nothing to do with picking an ASP.NET or .NET
framework version per se.

Script mapping is for mapping any file extension to any ISAPI extension
(whether that be classic ASP, PHP ISAPI, Server Side Includes ISAPI, and
numerous other types)

Cheers
Ken
 
D

David Wang

Technically script mapping has nothing to do with picking an ASP.NET or .NET
framework version per se.

Script mapping is for mapping any file extension to any ISAPI extension
(whether that be classic ASP, PHP ISAPI, Server Side Includes ISAPI, and
numerous other types)

Cheers
Ken

--http://www.adopenstatic.com/blog









- Show quoted text -


Ok, here's the details.

From IIS's perspective, it only handles:
1. Static File like .HTML
2. CGI EXE which are launched in a separate process to generate
response
3. ISAPI DLL which are launched in-process to generate response

Resources like .asp and .aspx are external scripts handled and
processed by script handlers. These handlers are defined via Script
Mappings (or Application Mappings using IIS documentation's jargon).
All IIS does is figure out if a resource has an extension specified in
a Script Mapping and if so, run the Script Engine according to whether
it is a CGI or ISAPI and pass the resource as input to the Script
Engine.

In the case of ASP, a .asp file is just a script file parsed by the
Windows Scripting Host to generate content. In the case of ASPX,
a .aspx file is just a snippet of .Net code parsed by the CLR hosted
by ASP.Net to generate content. And all the code-behind, etc are
simply special logic implemented by ASP.Net and parsed through CLR to
generate the behaviors you observe.

From IIS's perspective, .asp and .aspx resources are just Script
Mapped resources which are handled by ASP.DLL and ASPNET_ISAPI.DLL and
via some internal process (involving CLR or Windows Scripting Host),
generates response for it to send back.


//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//
 

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