What could cause an error with .Net 4.0 and IIS 6?
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 unde开发者_开发问答r IIS 6 on Windows Server 2003.
Does anyone have any ideas what I might be missing here?
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
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.
精彩评论