New Web Sites - Not Serving Up ASPX Pages (but .htm is okay)

F

Frankie

I'm writing a small C# utility application that creates new Web Sites via
ADSI. It seems to work just fine for the most part -- meaning that IIS
Metabase entries look either identical or "different where expected" - when
comparing Web Sites created with my utility against Web Sites created
"manually" with IIS Manager. I'm comparing the sites visually (eye balling
it) with Metabase Explorer.

The problem I have with Web Sites created with my utility is that they can
serve up index.htm just fine, but not even the simplest version of
default.aspx.

The error message I get when attempting to view the page in IE6 is "The Page
cannot be displayed" and "Cannot find server or DNS Error". I have
eliminated DNS as the problem because I can PING the Web site by its domain
name (over the Internet) - and it serves up index.htm just fine.

The Default.aspx page has only <%@ Page %> at the top followed by the
usual/minimal HTML elements to define a page. When viewing the Web site
through IIS Manager - the Documents tab does in fact have a check in the
checkbox for "enable default content page" and default.aspx is listed there
as the only document (unless I swap that out for index.htm for testing
purposes).

Any suggestions for helping me determine what is causing the site to not
serve up aspx pages are greatly appreciated.

FWIW: IIS 6.0, I have stopped and restarted the Web site via IIS Manager,
and I have also recycled the application pool to which it belongs.

Thanks!
 
F

Frankie

I came up with a work-around; but I'd still appreciate any suggestions so
that I don't have to do this work-around:

The way I have found to get these sites to serve up aspx pages is to open
IIS Manager, view the properties for the site in question, go to the [Home
Directory] tab, and click [Remove] next to the Application Name textbox in
the Application Settings area. Then I immediately click on [Add] to add the
application back in. That fixed it (the site then served up aspx pages just
fine). I also recycled the Application pool - but that may have been
unnecessary.

Any ideas?

Thanks!
 
J

Juan T. Llibre

What you're missing is

1. mapping the application to aspnet_isapi.dll.

drive:\WINDOWS\MICROSOFT.NET\FRAMEWORK\Vx.x.xxxxx\aspnet_isapi.dll

There's several extensions which you should map to aspnet_isapi.dll.

See a list at :
http://www.microsoft.com/mspress/books/sampchap/6667.asp

You probably should look at running aspnet_regiis.exe for the virtual
root you created, with the parameters you desire, typically -i .

and

2. setting the default document to "default.aspx".

You'd have to use ADSI for that :

'Only setting two properties
vDir.DefaultDoc = vDir.DefaultDoc & ",default.aspx"

'Write information back to Metabase
vDir.SetInfo

See http://www.15seconds.com/issue/980304.htm for an example.







Frankie said:
I came up with a work-around; but I'd still appreciate any suggestions so that I don't
have to do this work-around:

The way I have found to get these sites to serve up aspx pages is to open IIS Manager,
view the properties for the site in question, go to the [Home Directory] tab, and click
[Remove] next to the Application Name textbox in the Application Settings area. Then I
immediately click on [Add] to add the application back in. That fixed it (the site then
served up aspx pages just fine). I also recycled the Application pool - but that may
have been unnecessary.

Any ideas?

Thanks!


Frankie said:
I'm writing a small C# utility application that creates new Web Sites via ADSI. It
seems to work just fine for the most part -- meaning that IIS Metabase entries look
either identical or "different where expected" - when comparing Web Sites created with
my utility against Web Sites created "manually" with IIS Manager. I'm comparing the
sites visually (eye balling it) with Metabase Explorer.

The problem I have with Web Sites created with my utility is that they can serve up
index.htm just fine, but not even the simplest version of default.aspx.

The error message I get when attempting to view the page in IE6 is "The Page cannot be
displayed" and "Cannot find server or DNS Error". I have eliminated DNS as the problem
because I can PING the Web site by its domain name (over the Internet) - and it serves
up index.htm just fine.

The Default.aspx page has only <%@ Page %> at the top followed by the usual/minimal
HTML elements to define a page. When viewing the Web site through IIS Manager - the
Documents tab does in fact have a check in the checkbox for "enable default content
page" and default.aspx is listed there as the only document (unless I swap that out for
index.htm for testing purposes).

Any suggestions for helping me determine what is causing the site to not serve up aspx
pages are greatly appreciated.

FWIW: IIS 6.0, I have stopped and restarted the Web site via IIS Manager, and I have
also recycled the application pool to which it belongs.

Thanks!
 
F

Frankie

Thanks Juan,
What my utility was missing was a call to AppCreate2.

Basically the application wasn't being created correctly in IIS even though
I was explicitly setting all of the metabase properties (or at least those
properties that I could see through Metabase Explorer).

And, just in case others are interested in this thread, I tried
aspnet_regiis as suggested, but it didn't solve the problem. I'm not sure
what all AppCreate2 does behind the scenes, but whatever it does is
apparently necessary; and not all of its changes are apparent in Metabase
Explorer.

Thanks again!

-F


Juan T. Llibre said:
What you're missing is

1. mapping the application to aspnet_isapi.dll.

drive:\WINDOWS\MICROSOFT.NET\FRAMEWORK\Vx.x.xxxxx\aspnet_isapi.dll

There's several extensions which you should map to aspnet_isapi.dll.

See a list at :
http://www.microsoft.com/mspress/books/sampchap/6667.asp

You probably should look at running aspnet_regiis.exe for the virtual
root you created, with the parameters you desire, typically -i .

and

2. setting the default document to "default.aspx".

You'd have to use ADSI for that :

'Only setting two properties
vDir.DefaultDoc = vDir.DefaultDoc & ",default.aspx"

'Write information back to Metabase
vDir.SetInfo

See http://www.15seconds.com/issue/980304.htm for an example.







Frankie said:
I came up with a work-around; but I'd still appreciate any suggestions so
that I don't have to do this work-around:

The way I have found to get these sites to serve up aspx pages is to open
IIS Manager, view the properties for the site in question, go to the
[Home Directory] tab, and click [Remove] next to the Application Name
textbox in the Application Settings area. Then I immediately click on
[Add] to add the application back in. That fixed it (the site then served
up aspx pages just fine). I also recycled the Application pool - but that
may have been unnecessary.

Any ideas?

Thanks!


Frankie said:
I'm writing a small C# utility application that creates new Web Sites
via ADSI. It seems to work just fine for the most part -- meaning that
IIS Metabase entries look either identical or "different where
expected" - when comparing Web Sites created with my utility against Web
Sites created "manually" with IIS Manager. I'm comparing the sites
visually (eye balling it) with Metabase Explorer.

The problem I have with Web Sites created with my utility is that they
can serve up index.htm just fine, but not even the simplest version of
default.aspx.

The error message I get when attempting to view the page in IE6 is "The
Page cannot be displayed" and "Cannot find server or DNS Error". I have
eliminated DNS as the problem because I can PING the Web site by its
domain name (over the Internet) - and it serves up index.htm just fine.

The Default.aspx page has only <%@ Page %> at the top followed by the
usual/minimal HTML elements to define a page. When viewing the Web site
through IIS Manager - the Documents tab does in fact have a check in the
checkbox for "enable default content page" and default.aspx is listed
there as the only document (unless I swap that out for index.htm for
testing purposes).

Any suggestions for helping me determine what is causing the site to not
serve up aspx pages are greatly appreciated.

FWIW: IIS 6.0, I have stopped and restarted the Web site via IIS
Manager, and I have also recycled the application pool to which it
belongs.

Thanks!
 

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

Forum statistics

Threads
473,995
Messages
2,570,225
Members
46,815
Latest member
treekmostly22

Latest Threads

Top