"Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive." yet application is set to 4.0 in IIS6

StackOverflow https://stackoverflow.com/questions/21086990

Domanda

I am running IIS6.

The application was previous 2.0, but was switched to target 4.0. I have .NET Framework 4 installed on the server. The application has been given its own application pool (I keep reading that the application pool needs to be set to 4.0, but I don't see an option for that anywhere. Assuming this is IIS7+). I have right clicked the virtual application -> Properties -> ASP.NET and ASP.NET version has been set to 4.0.

However, when I attempt to run it, I am greeted with:

Parser Error Message: Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.

Line 23:     <compilation debug="true" targetFramework="4.0" />

Version Information: Microsoft .NET Framework Version:2.0.50727.3649; ASP.NET Version:2.0.50727.3634

Why even when it is set for 4.0 within IIS, does it still think it should be running 2.0? I Looked throughout the web config to see if there was anything to suggest it would, but no such item.

È stato utile?

Soluzione

From the Microsoft article here, ASP.NET 4 Child Applications Fail to Start When Under ASP.NET 2.0 or ASP.NET 3.5 Applications. You'll need to put inheritInChildApplications="false" into your parent ASP.NET web.config file.

Here's the example they show in the article:

<location path="" inheritInChildApplications="false" >
  <appSettings />
  <connectionStrings />
  <system.web>
    <!-- Removed for brevity -->
  </system.web>
  <system.codedom>
    <!-- Removed for brevity -->
  </system.codedom>
  <system.webServer>
    <!-- Removed for brevity -->
  </system.webServer>
</location>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top