tags:

views:

255

answers:

3

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?

+3  A: 

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.

Will
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
@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.
Will
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
@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.
Will
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
A: 

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
A: 

THANK YOU PETE! You saved me a great deal of aggravation with the ".NET4 set to prohibited" in Web Service Extentions. Now, why would Microsoft default to that?

Troy in Texas
Hey, bumbling around the menus can be useful, I guess ;) Glad it worked!
pete the pagan-gerbil