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

Abdul Rehman Sayed picture Abdul Rehman Sayed · Feb 6, 2017 · Viewed 58.8k times · Source

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>

Answer

Abdul Rehman Sayed picture Abdul Rehman Sayed · Feb 7, 2017

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.