Asp.NET web app insists on loading .NET 2.0

40 Views Asked by At

I have a very simple project that suddenly wants to load .NET version 2

The <compilation> tag in the web.config includes targetFramework="4.6.1"

The Target framework under the project properties is also set to 4.6.1

But the IISExpress instance shows version 2

enter image description here

<?xml version="1.0"?>
<configuration>
  <appSettings/>
  <connectionStrings>
    <add connectionString="xxx" name="x"/>
  </connectionStrings>
  <system.web>
    <compilation debug="true" targetFramework="4.6.1"/>
    <authentication mode="Windows"/>
    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
  </system.web>
</configuration>
1

There are 1 best solutions below

0
On BEST ANSWER

I solved this by updating the target framework in the Solution file