title: How to register Dot net framework 4.6.2 on IIS 8.5 in Windows Server 2012 R2
body: <p>I installed dot net framework 4.6.2 from <a href="https://www.microsoft.com/en-us/download/details.aspx?id=48137" rel="noreferrer">this</a> path &amp; now want to register this in IIS.</p>
  
  <p>If it was a earlier framework version (2.0,3.5,etc ) &amp; an earlier server ( For Eg Windows 2003), I would have typed the following command
  in the appropriate path. </p>
  
  <pre><code>C:\Windows\Microsoft.NET\Framework64\v4.0.30319&gt;aspnet_regiis -i 
  </code></pre>
  
  <p>However, I cannot find the folder path of 4.6.2 on this server. &amp; even installing this command from here gives the below message :</p>
  
  <blockquote>
    <p>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 
    <a href="http://go.microsoft.com/fwlink/?LinkID=216771" rel="noreferrer">http://go.microsoft.com/fwlink/?LinkID=216771</a>.  Finished installing 
    ASP.NET (4.0.30319.0).</p>
  </blockquote>
  
  <p>I know the web link in message is for 4.5 because 4.5 is an in-place upgrade for 4.0. </p>
  
  <p>My website gives this error :</p>
  
  <blockquote>
    <p>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.</p>
  </blockquote>
  
  <p>The relevant part of web.config is : </p>
  
  <pre><code>&lt;system.web&gt;
      &lt;compilation debug="true" targetFramework="4.6.2"/&gt;
      &lt;httpRuntime targetFramework="4.6.2"/&gt;
  &lt;/system.web&gt;
  </code></pre>