views:

824

answers:

4

I'm using Visual Studio's built in web server to test and EPiServer applicaiton. When I have the app running in IIS, if I hit the root of the virtual directory, EPiServer will take over and server the defaul page to me. Using the Visual Studion server (which I am doing for license reasons with the SDK), it always gives me the 'Directory Listing' view of my site. Does anyone know how to configure this web server to not allow the directory listing/browsing?

Additional Information: This problme only seems to effect the root of the visual studion web server (i'll call it cassini from here on in). As an example, if I run a site from localhost:6666, then what I will find is that localhost:6666/en/ will work just fine and the EPiServer VPP will know what it is doing. If I use localhost:6666/, then the VPP never kicks in (or so it seams). It seems to me that when the root of cassini is hit, it checks to see if the page exists (which it does not as I have no default). If it decides that the page does not exist, then it serves up the directory listing, rather than 404. The first thing to do for me is to dispable directory browsing in cassini, then look at why the VPP is not being actioned correctly.

So I suppose the base of the question is: Is there a way to modify these settins in Cassini when it is Visual Studio starting everything off?

(EPiServer may be a red herring, but just in case, it's CMS version 5)

Further Update I managed to get hold of the source for Cassini 3.5 and gave that a whirl. 3.5 works just fine and behaves like IIS in this instance. I.e. the lack of default document does not lead to a Directory listing, rather if allows the HTTP handlers to kick in and then EPiServer does the rest! So the question is, can I achieve the same in Visual Studios effort at a web server?

A: 

Even if you could get the server to not show the directory listing, could you get EPiServer to take over?


EDIT: From comments The fact that it works with /en/ makes me think this is something that Microsoft could fix. I suggest you ask the vendor if they have a workaround. If they do not, then please create a suggestion at http://connect.microsoft.com/visualstudio/. Be sure to specify details about EPIServer, URL to the vendor, etc.

Be clear that it works with /en, but you want a setting permitting it to work at the root.

Once you create the suggestion, please edit your question to include the link to the suggestion you create. That way, others reading your question can vote on how important they think this is.

John Saunders
I would assume so. As I said. It does this fine in IIS when directory browsing is disabled. It also does it fine if I specify a language such as http://localhost:6666/en/, but using http://localhost:6666/ just gives the directory listing. It has had me grumbling alot today :)
mnield
(grr - i didn't want thos elinks to render like that, imagine some http:// bits)
mnield
A: 

The EpiServer part confuses me. However, if you are asking how to set the default page for the VS development server (based on the Cassini code), you're expected to do that in the project properties (right click on web project), Web, Start Action, Specific Page, foo.aspx.

I suspect the cassini/VS development server doesn't have a default page feature-- the source code for the cassini server (the ancestor of the VS development server) is on the web and you can check that and add a default page by building a custom version. And it doesn't have a very long list of other features that IIS has.

MatthewMartin
Thanks matt, I'll have a look at teh source and see if I can gleen anything that might help regarding the root.
mnield
Iterasting, got a copy of Cassini 3.5 and it works like a charm! I'll update my question
mnield
A: 

Which EPiServer version are you running? Did you install it using EPiServer Manager?

There has always been some differences in the configuration between running the site at the root of a host name or as a (virtual) directory.

Check the site settings block in web.config and make sure you have a default.aspx at the project root.

Johan Kronberg
I'm running version 5.2.375.133 (I probaly can get away with saying CMS 5 SDK :))I can put a default.aspx in of course. But my query really is more that, when I don't have a deafult.aspx and point the same code through IIS, EPiServer will automatically pickout the first enabled language, but in the Visual Studio web server it seems to be assuming that there is no default document, ignoring the VPP and chucking back a directory listing. So maybe I'm really asking how to make the web server do the equivalent of not allowing directory browsing... alternatively I'm rambling like a mad man.
mnield
+1  A: 

Make sure you have a ~/Default.aspx file. It won't render, but it's needed in cassini for the virtual path providers to get a chance to handle the request for '/'. Of course, if you make it anyway you might as well use it for the start page :-)

Allan Thraen
Cheers Allen, this is pretty much what I ended up doing in the end :)
mnield

related questions