Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can you get a .NET 4.5 website to run on IIS6?

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

like image 720
CodeRedick Avatar asked Oct 10 '12 17:10

CodeRedick


People also ask

How do I enable .NET Framework 4.5 on Windows?

Select Start > Control Panel > Programs > Programs and Features. Select Turn Windows features on or off. If not already installed, select Microsoft . NET Framework and click OK.

How do I install ASP NET 4.5 on Windows 10?

Open the Control Panel, click "Programs" and then click "Turn Windows features on or off" to open the "Windows Features" dialog. 2. Enable ". NET Framework 4.5 Advanced Services > ASP.NET 4.5" (version 4.6 in Windows 10):


1 Answers

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

like image 127
SLaks Avatar answered Oct 05 '22 19:10

SLaks