I have deployed an ASP.NET MVC web application to an IIS 7 server. It's in the root directory of the www folder. There is a sub folder that is not part of the application that needs to be served up as normal. So I added some code into my MVC app routes.
Basically I:
routes.IgnoreRoute(name);
var ignore_route = string.Concat(name, @"\/(.*)");
routes.IgnoreRoute("{*path}", new { path = ignore_route });
This words perfectly. For a while. Then it breaks. Specifically, going to "/subDirectory" (i.e. without the trailing slash) gives a "401 - Unauthorized: Access is denied due to invalid credentials." This wouldn't bother me except for the fact that due to business cards in the wild giving the subDirectory url without the trailing slash. It has to work.
It always works fine on my dev machine, but it's not running on IIS there.
I don't understand how it could work for a while and then break. If I copy over the assembly, it starts working again, and then it stops by the next day.
One possibility is that when I first deployed this web application, this code was not present. I had to add it later when we realized that there needed to be subdirectories that would be served up normally. So my first gut feeling was that it was somehow reverting back to an older version of the assembly. I have no idea how this would happening, though. When I access the directory via ftp, the modified dates are correct. The only access I have to the server is through ftp, but the server admins who are supposed to be helping me with this have been frustratingly absent. I'm at my wits end. Any ideas?
EDIT: I don't know why this was sent over here to stack overflow. This is obviously a server issue, isn't it? Look at the first response! It's talking about the server. The code works fine. Can we get this booted back over to serverfault where it belongs?