1
votes

Before change:

I have website local.Mywebsite.com hosted in my Local IIS 7.5.The website is running in .net version 4.0 and IIS app pool is in Integrated pipeline mode. It is working perfectly fine.

I am able to Browse the local.Mywebsite.com/default.aspx as local.Mywebsite.com It means IIS serving the default document as i configured.

The Change:

I had a requirement to include another application Foo to My website as virtual directory.I added that and am able to Browse and use the same with complete path as local.Mywebsite.com/Foo/Mypage.aspx.

Then i configured a default document for my Foo virtual directory.

MY issue:

I try to browse to local.Mywebsite.com/Foo/

I got an error:

The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies)
could have been removed, had its name changed, or is temporarily unavailable.  
Please review the following URL and make sure that it is spelled correctly. 

Now IIS is not serving default document for my Foo virtual directory.

But still am able to browse local.Mywebsite.com, IIS serves default document here.

Any one have any idea or any suggestions are highly appreciated.

Update:

When i Rename the file Mypage.aspx in to Default.aspx, then IIS serves the default document pretty fine. Am able to see the default.aspx page by browsing local.Mywebsite.com/Foo/.

My Web config:

<defaultDocument enabled="true">
  <files>
    <clear/>
    <add value="Mypage.aspx" />
  </files>
</defaultDocument>
1
i had check this one also stackoverflow.com/questions/6948669/… but this is for classical pipeline modeArun Chandran C
Can you post the relevant web.config section for /Foo?Kev
Also you've used two incorrect spellings of default.aspx : deafualt.aspx and defualt.aspx, are these just typo's in your question?Kev
@Kev thanks for time spelling is corrected in my question and this was not the issue.Which config section are you expecting ?Arun Chandran C
You've still got the spelling wrong :) defualt.aspx -> default.aspx. The default document config section is what I'm looking for.Kev

1 Answers

1
votes

It gives 404 error when you are running the application in debug mode on your machine.

1.Please verify in your web.config that you have the following set-up

<authentication mode="Windows"/>

  <identity impersonate="true"/>

  <authorization>

  <allow users="*"/>

</authorization>

I have a similar problem before and adding <identity impersonate="true"/> solve it.

2.Make sure you have a correct version of .NET selected in IIS(which in your case is .NET 4.0)
3.This also occur if you don't have a start page set under your web project's properties
4.Try also to clear your browsing data. Especially when you are using IE.

If the error still shows, set custom error mode off in the web.config so that you will see where the real problem is coming and you could sort it out. :)