1

I have two websites on IIS 6 that throw server errors when they are set to ASP.NET 2 (via the ASP.NET tab in IIS properties) - one because of a dependancy on a library built in .NET 4, the other because it is an N4/MVC2 application which specifies 4.0 as it's targetFramework in config.

When I change the setting in the ASP.NET tab to be .NET 4, both websites just return 'page cannot be found' errors, even when pointed at a specific page (by route in the MVC app, an .aspx file in the ASP.NET app).

I've tried adding a wildcard ISAPI filter to the MVC app as described a few places online, but this hasn't done anything (either when pointed at the 2.0 dll or the 4.0 dll). The versions of .NET 4 on the server and in Visual Studio are the same (4.0.30319).

I am running under IIS 6 on Windows Server 2003.

Does anyone have any ideas what I might be missing here?

DaveRandom
  • 87,921
  • 11
  • 154
  • 174
pete the pagan-gerbil
  • 3,136
  • 2
  • 28
  • 49
  • possible duplicate of [Deploy asp.net mvc beta to iis 6 causing 404's](http://stackoverflow.com/questions/239981/deploy-asp-net-mvc-beta-to-iis-6-causing-404s) – Malfist May 11 '10 at 15:37
  • I've already tried the top-voted solution on there, both in the v2 and v4 folders, and no luck. And it doesn't solve the ASP.NET application problem, since that has an .aspx extension anyway (therefore doesn't need a wildcard to be passed to aspnet_isapi.dll). – pete the pagan-gerbil May 11 '10 at 15:40

2 Answers2

4

As per Pete's comment, the answer for me was:

It was a setting in IIS, Web Service Extensions. .NET 4 was set to prohibited. Allowed it, and everything worked

Daniel O
  • 2,810
  • 3
  • 28
  • 35
3

Obviously, your app must run in v4 of the CLR. That part is clear. Getting your ISAPI filters correct can be a struggle. First, you'll need to ensure (and I mean ensure, don't just glance at it and think its correct, copy/paste the path and make sure everything is pointing correctly) all filters are pointing to the correct v4.0 DLLs. Next, make sure your wildcard filter doesn't have the "ensure file exists" checkbox checked. This is what caused me the most issues. Lastly, ensure your permissions are correct.

If it still isn't working, you'll need to turn on fusion logging, check your iis logs, and maybe even pull out Process Monitor to see what IIS is trying to do when you connect to the server.

  • Ouch, that's so much rougher than I'm used to. I had this silly notion that updating to v4 would just be 'change project, install framework on server, check this, change that, et voila!' I'll double-check all these when I'm back in the morning, I did it for one site but not both... And the wildcard filter definately absolutely does not have that box checked, that was clear in the blog advice I read. – pete the pagan-gerbil May 11 '10 at 16:33
  • @pete iis6 isn't exactly the easiest thing to get up and running. There are so many bits and parts that have to be working, and when they don't all you get is that goddamn 404. –  May 11 '10 at 17:10
  • Damn. I've not had to do anything worse than add a website before, and that always worked... and I can make these work (well, throw a framework error) if I tell it to use .NET 2... I'll keep googling. – pete the pagan-gerbil May 12 '10 at 07:57
  • @pete Always check your logs, turn on the fusion log and, as last resort, Process Monitor. Also, make sure you got the user rights correct on that directory and all subdirectories. That's always another thing that can go wrong. Here's another tip: Use the Web platform Installer to install an MVC website (and ensure your prereqs are installed correctly!). If you can install, say, AtomSite and access it you know your machine isn't the issue, it has to be user rights or configuration errors. Then you can do a side by side comparison to locate your issue. Good luck. –  May 12 '10 at 12:54
  • 3
    Thanks for your help - I managed to stumble on the answer in the end, but yours is a better way of finding the answer! It was a setting in IIS, Web Service Extensions. .NET 4 was set to prohibited. Allowed it, and everything worked! As I say, yours would be the sensible way to catch the problem, rather than blind luck. – pete the pagan-gerbil May 12 '10 at 13:01