- Posted by justin on October 17, 2004
We ran across a problem with VS 2002 and IIS 6 where it would not find the web directories or tell you that the directory location did not match the URL. Below is how to fix this problem.
The problem may be that Internet Information Server 6.0 blocks all
extensions that are not explicityly mapped (for security purposes), while
VS.Net tests whether the URL and UNC path match by writing a file with the
".tmp" extension to the server and then requesting it back via an http
call. Since Internet Information Server 6.0 blocks .tmp file the call fails
with a 404 error.
Workaround
1. Launch the Internet Information Services MMC.
2. Right click on your web site and click properties.
3. In the 'HTTP Headers' tab click 'MIME Types...' button.
4. Add a new MIME type by clicking 'New...' button.
5. In the 'Extension' edit control type (without the quotes) '.tmp'.
6. In the 'MIME type' edit control type (without the quotes) 'temp'.
The above steps will allow .tmp files to be served up by IIS. On a
development machine where web project are created this is usually not an
security concern. However if you have .tmp which contain sensitive data
which you do not want exposed, you will have to reverse the above 6 steps.
If the mime entry for .tmp file is deleted after creating the project you
will receive a http 404 error when you try to reopen the project. So you
will have add .tmp mime type before you open the project and remove it
after opening the project.