Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to register Dot net framework 4.6.2 on IIS 8.5 in Windows Server 2012 R2

I installed dot net framework 4.6.2 from this path & now want to register this in IIS.

If it was a earlier framework version (2.0,3.5,etc ) & an earlier server ( For Eg Windows 2003), I would have typed the following command in the appropriate path.

C:\Windows\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis -i 

However, I cannot find the folder path of 4.6.2 on this server. & even installing this command from here gives the below message :

Microsoft (R) ASP.NET RegIIS version 4.0.30319.0 Administration utility to install and uninstall ASP.NET on the local machine. Copyright (C) Microsoft Corporation. All rights reserved. Start installing ASP.NET (4.0.30319.0). This option is not supported on this version of the operating system. Administrators should instead install/uninstall ASP.NET 4.5 with IIS8 using the "Turn Windows Features On/Off" dialog, the Server Manager management tool, or the dism.exe command line tool. For more details please see http://go.microsoft.com/fwlink/?LinkID=216771. Finished installing ASP.NET (4.0.30319.0).

I know the web link in message is for 4.5 because 4.5 is an in-place upgrade for 4.0.

My website gives this error :

The 'targetFramework' attribute in the element of the Web.config file is used only to target version 4.0 and later of the .NET Framework (for example, ''). 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.

The relevant part of web.config is :

<system.web>
    <compilation debug="true" targetFramework="4.6.2"/>
    <httpRuntime targetFramework="4.6.2"/>
</system.web>
like image 466
Abdul Rehman Sayed Avatar asked Feb 06 '17 15:02

Abdul Rehman Sayed


2 Answers

IIS will not display the .NET 4.6.2 application pool when you select the .NET CLR version for application pool. Both 4.0 and 4.6.2 will use .NET CLR Version v4.0.30319.

Here is the link for reference:

https://forums.iis.net/t/1237493.aspx?Link+net+framework+4+6+2+windows+2012R2+to+IIS

like image 128
zmechanic Avatar answered Jan 03 '23 13:01

zmechanic


It turns out I had downloaded a wrong installer. it was of 4.6 whereas I needed 4.6.2 which is available here.

The question deserves deletion but i wont coz some one else might commit the same sin.

like image 29
Abdul Rehman Sayed Avatar answered Jan 03 '23 15:01

Abdul Rehman Sayed