views:

55

answers:

2

Any ideas why the built in asp.net webserver insists on serving "/default.aspx" whenever you browse to the root "/"?

Even if you force the global.asax to redirect to "/" whenever "/default.aspx" is detected it will see "/" as a request to "/default.aspx" and an infinite loop ensues!

Anyone have a way around this behaviour?

+1  A: 

I assume you're talking about Cassini (the one Visual Studio comes with for development) - if so then you're out of luck because you can't change the default document it uses (or not in any way I know of anyway).

To work around it you can set your project to use a local IIS installation instead - that will give you more control over directory browsing, default documents etc.

Steven Robbins
Yea, i thought that was the case! iis is an option but i'm thinking of putting code in place to handle that 'special case'
Adam Naylor
@Adam - I'd say setting up IIS would be better as it would emulate the production environment better and the code to handle the 'special case' is only need during develpment.
WestDiscGolf
I'd definately just go for IIS - you can setup a virtual directory to point to your code, so there's no complicated deployment nonsense, and every dev machine should be able to have IIS on it.
Steven Robbins
Ok good advice. One question though. Are there any quirks that IIS development may introduce? Switching from cassini just to solve this problem only to open another can o worms may be a tall order...
Adam Naylor
@Adam - It shouldn't do, it's the way we used to work before Cassini turned up and I would imagine it's going to be deployed to IIS for production anyway.
Steven Robbins
A: 

If you are using Web projects (with Visual studio 2005 SP1 or 2008) you can modify the starting page that displays when you start debugging from visual studio. You can change this in the 'Web' tab of the projects property pages, in the 'Start action' section.

-Edoode

edosoft