Вопрос

I have an IIS website running an ASP.NET site but it has multiple applications running under it (a virtual directory with separate app pools basically).

Well - I need two separate applications which point to the same root folder director but I want the apps to have separate default documents. The reason is because this is how it is configured in production and this is on my development box.

The problem is that IIS keeps giving me the SAME default document for both apps (which are separate virtual paths and separate app pools just same physical location). How can I overcome this or can I not in IIS7?

I am going to be re-writing the whole thing and it will not be done this way in the furture...but until then I need to fix some bugs and want a local dev environment. Help!

Это было полезно?

Решение

In order to accomplish this and preserve the setup implemented in our sites I needed to add a location tag around the System.WebServer element in the root site web.config and specify the default document in there as follows where the path is the VirtualDirectory/Application name:

<location path="VirtualDirectoryName">
    <system.webServer>
        <defaultDocument>
            <files>
                <clear />
                <add value="Document.asp" />
            </files>
        </defaultDocument>
    </system.webServer>
</location>
<location path="VirtualDirectoryName2">
    <system.webServer>
        <defaultDocument>
            <files>
                <clear />
                <add value="AnotherDocument.asp" />
            </files>
        </defaultDocument>
    </system.webServer>
</location>
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top