2

I have still problem with asp.net project. In Visual studio when i start debug it is all good and page working but, when i try it on iis7 showse this error.

SHOW ERROR:

Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

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

Source Error:

Line 18:     </connectionStrings> 
Line 19:     <system.web> 
Line 20:       <compilation debug="true" targetframework="4.0" /> 
Line 21:     </system.web> Line 22: 

Source File: C:\inetpub\wwwroot\web.config Line: 20

It seems problem with targetFramework but i do not know if i have to configure iis server or something chane in my web-config.

thx.

BrunoLM
  • 97,872
  • 84
  • 296
  • 452
Eduard Baraniak
  • 421
  • 1
  • 10
  • 31
  • 1
    The targetframework is for version 4, you probably run your web on previous version, also http://forums.asp.net/t/1491204.aspx and http://msdn.microsoft.com/en-us/library/system.web.configuration.compilationsection.targetframework.aspx – Aristos May 31 '11 at 13:06

3 Answers3

6

Change the .NET version on the Application pool for your website. It must be .NET 4.0, not the .NET 2.0 View a List of Application Pools (IIS 7)

VMAtm
  • 27,943
  • 17
  • 79
  • 125
  • true thanks and plese how can i cange appilcation pool ? sorry i am only student an this is my first time with iis7... thx lot – Eduard Baraniak May 31 '11 at 13:08
  • 1
    Open IIS, connect to server, use Application pool tree node. Select Application pool you need and change its parameters – VMAtm May 31 '11 at 13:14
  • thx. but now show me new error: on SERVER DEFAULT WEB PAGE HTTP Error 500.21 - Internal Server Error Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list ................. Maybe i have to reinstal iis7... – Eduard Baraniak May 31 '11 at 13:17
  • No, you don't need to reinstall. You need to add httpmodule to the iis 7.0. Link: http://www.west-wind.com/weblog/posts/2007/Oct/10/HttpModule-and-HttpHandler-sections-in-IIS-7-webconfig-files – VMAtm May 31 '11 at 13:19
  • @Eddy `Looks like you have not installed the asp.net feature from within IIS in "Add/Remove windows component" so that all the regstration needed to run asp.net is not present in your configuration.` http://forums.iis.net/t/1149449.aspx – BrunoLM May 31 '11 at 13:21
  • @Eddy this worked for that guy: (run > cmd) `run %windir%\Microsoft.NET\Framework\v4.0.21006\aspnet_regiis.exe -i` – BrunoLM May 31 '11 at 13:22
3

Ensure the application pool is set to use .NET 4.0.

Oded
  • 489,969
  • 99
  • 883
  • 1,009
3

Change your application pool to be compatible with .NET 4.0.

click to edit

Open IIS then click on an application pool on the list and modify it to use .NET Framework 4.0.

BrunoLM
  • 97,872
  • 84
  • 296
  • 452