简体   繁体   中英

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>

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.

For applications with target framework 4.6, register with these paths (depends on x64 or x86 version of Windows):

X86: %windir%\\Microsoft.NET\\Framework\\v4.0.30319

X64: %windir%\\Microsoft.NET\\Framework64\\v4.0.30319

In command prompt, first got to one of above directory then run

aspnet_regiis.exe -i

In Application Pool setting use .Net Framework v4.0.30319

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

Try dism tool to enable features in Windows.

To install .NET 4.5 or 4.6 into IIS, run the following command. [Restart the machine if required]

dism /online /enable-feature /featurename:IIS-ASPNET45 /all

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM