I ran across this error after pushing out an upgraded .NET 4.0 MVC2 application to its existing IIS website.  After some digging around I found this document on MSDN: How to: Upgrade an ASP.NET Web Application to ASP.NET 4

Since the application was previously built on version 3.5, IIS was configured to run as Asp.Net 2.0. Well it turns out IIS runs under the new framework version 4.0. (not like 3.0, or 3.5 when the Application Pool runs as 2.0)

Kind of one those "I should have figured that out much quicker moments"… A simple change to the app pool to target 4.0, and were on our way.

Previous post

StructureMap and SharePoint

Next post

Delete a work Item in TFS


  1. November 12, 2009 at 1:33 pm

    I was having this problem with a WCF service, to fix it I just removed the target framework from the web.config

  2. November 12, 2009 at 1:44 pm

    if you removed it from the web.config and did not update the app pool, then chances are your WCF service is using 2.0 and targeting the incorrect http handler (svc-Integrated vs svc-Integrated-4.0). A symptom of this might be that is works in 2008, and not 2010 🙂

  3. November 12, 2009 at 1:53 pm

    maybe, but that shouldn’t matter, I’m consuming a soap web service, it shouldn’t matter if it was 2.0, 3.5, 4.0 or even java for that matter. The whole point of web services are for interoperability

  4. November 12, 2009 at 2:15 pm

    well, I think the point of the post is targeting .net 4.0 features. So, if you don’t want to take advantage of them, then yes, you can remove the attribute and run 3.5.

    There are quite a few improvements in the WCF service stack for 4.0, in which you can take advantage of if you run .net on both sides. (Especially for Silverlight, e.g DomainServce, Entity change tracking etc)

  5. October 27, 2011 at 8:48 am

    I had the same problem but using VS’ virtual server not IIS.
    So here an article that could help you if you have the same problem:

  6. October 27, 2011 at 6:36 am

    Excellent information.. which I believe will be very useful for me.