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...

SteveC
  • 13,636
  • 21
  • 86
  • 155
CodeRedick
  • 7,062
  • 7
  • 43
  • 70
  • 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 Oct 10 '12 at 18:08

1 Answers1

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.

SLaks
  • 800,742
  • 167
  • 1,811
  • 1,896
  • Except that I'm already well into development before noticing... and have a really tight deadline. :) – CodeRedick Oct 10 '12 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 Oct 10 '12 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 Oct 11 '12 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 Nov 11 '13 at 12:56
  • @Peter - That's absolutely not true, you need only upgrade the .browser files, there is a download to do that. – Erik Funkenbusch Aug 18 '14 at 05:53
  • @ErikFunkenbusch Please provide a link to this download, i have tried every thing to solve this problem on one of our servers and its still there today... – Peter Aug 18 '14 at 08:52
  • @Peter - http://www.hanselman.com/blog/BugAndFixASPNETFailsToDetectIE10CausingDoPostBackIsUndefinedJavaScriptErrorOrMaintainFF5ScrollbarPosition.aspx – Erik Funkenbusch Aug 18 '14 at 14:46
  • @ErikFunkenbusch This fixes the IE10 problems but not the IE11 problems as IE11 has a new useragent string format! – Peter Aug 19 '14 at 07:45
  • @ErikFunkenbusch we already have KB2836939v3 installed on the server. one example is that if you place a asp.net panel and set GroupingText. In non IE11 this renders as a
    , but on IE11 it renders as a
    ...
    – Peter Aug 20 '14 at 06:29
  • @Peter - I'll bet you (or someone else) installed a custom browser file at some point in the past, and that is messing things up. See http://www.hanselman.com/blog/IE10AndIE11AndWindows81AndDoPostBack.aspx Also, make sure you don't have any browsercaps entries in your web.config. I can find no reference to others having this groupingtext problem in IE11, so this seems like a problem with your installation. – Erik Funkenbusch Aug 20 '14 at 07:09
  • @Peter - Also, make sure you don't have an App_Browsers folder in your application, as any browser files in this folder (even if they're not IE) will break the new rendering methods, and IE11 won't be detected. Also, you might want to try reinstalling kb2600088 and kb2836939, and clearing the compiled browser file cache and recompiling it with aspnet_regbrowsers -i – Erik Funkenbusch Aug 20 '14 at 07:33
  • @SLaks Thanks for your answer. However, I just want to know Can I install .NET Framework 4.5 on XP / Server 2003 (x86-x64)? – VVB Apr 08 '15 at 05:40
  • @VVB you can't be serious? Just read the very first line of his answer ".Net 4.5 cannot be installed on Windows Server 2003." – Andrew Fox Aug 21 '15 at 04:12