24

I've got an old Windows 2003 server running IIS 6, and I chose .net 4.5 for my latest web app. Problem is I can't get it to run on the server...

.NET 4.0 framework is installed. I've run aspnet_regiis and deployed the website. I gave it it's own application pool. But I'm getting the following error:

The 'targetFramework' attribute in the <compilation> element of the Web.config 
file is used only to target version 4.0 and later of the .NET Framework (for 
example, '<compilation targetFramework="4.0">'). The 'targetFramework' attribute
currently references a version that is later than the installed version of the 
.NET Framework. Specify a valid target version of the .NET Framework, or install 
the required version of the .NET Framework.

I saw the requirements for .NET 4.5 as requiring Windows Server 2008 or later, but I'm seeing lots of posts with people just needing to configure the routing for MVC4 so it seems like this should be possible.

So any ideas what I need to do in order for this to work?

EDIT: The strange thing is we are using an ASP.NET Web API site that works just fine... but that should require .net 4.5...

1
  • 1
    MVC 4 / Web API only require .NET 4, not .NET 4.5. So if your application targets .NET 4 you'll be able to run all the way back to XP SP3 / Server 2003 if necessary.
    – Levi
    Commented Oct 10, 2012 at 18:08

1 Answer 1

39

.Net 4.5 cannot be installed on Windows Server 2003.

Instead, you should use MVC 4.0 on .Net 4.0, which will work fine.

13
  • Except that I'm already well into development before noticing... and have a really tight deadline. :)
    – CodeRedick
    Commented Oct 10, 2012 at 17:09
  • 1
    You can either downgrade .Net or upgrade Windows. Downgrading .Net shouldn't be too hard, unless you're using lots of new Task methods.
    – SLaks
    Commented Oct 10, 2012 at 17:13
  • Upgrade it is... just glad the ops guy was so agreeable! Too bad there's no workaround though... I really could see this being a problem in some environments.
    – CodeRedick
    Commented Oct 11, 2012 at 16:50
  • 1
    @Telos there is one major problem, .net 4.0 web forms doesn't detect IE11 correctly (some javascripts don't get rendered) and the only solution so far is to install .net 4.5...
    – Peter
    Commented Nov 11, 2013 at 12:56
  • @Peter - That's absolutely not true, you need only upgrade the .browser files, there is a download to do that. Commented Aug 18, 2014 at 5:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.