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
<?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>
I solved this by updating the target framework in the Solution file