2011-02-13 44 views
2

我剛剛部署了一個我一直致力於開發新機器的asp.net web應用程序。這是一個從3.5轉換爲4.0的項目。出於某種原因,當我嘗試通過我的IIS網站在默認網站下擊網站時出現以下錯誤:ASP.NET Web App使用錯誤的(2.0)CLR版本(而不是4.0)

無法識別的屬性'targetFramework'。請注意,屬性名稱區分大小寫。

它列出這個作爲是ASP.NET錯誤頁面上的配置錯誤:

<compilation debug="true" targetFramework="4.0"/> 

然而,我注意到,在錯誤頁面的底部,版本信息表明它正在使用版本2而不是版本4.任何人有關於如何解決這個問題的想法?

我已經確定我的默認網站使用.net 4 /集成應用程序池,並且在更改完成後,我會循環iis。仍然不是運氣。這裏是我的整個web.config文件:

<?xml version="1.0"?> 
<configuration> 
    <appSettings/> 
    <connectionStrings> 
     <add name="EventMasterConnectionString" connectionString="Data Source=localhost;Initial Catalog=BashBidder;Integrated Security=True" providerName="System.Data.SqlClient"/> 
    </connectionStrings> 
    <system.web> 
     <!-- 
      Set compilation debug="true" to insert debugging 
      symbols into the compiled page. Because this 
      affects performance, set this value to true only 
      during development. 
     --> 
     <compilation debug="true" targetFramework="4.0"> 
     </compilation> 
     <!-- 
      The <authentication> section enables configuration 
      of the security authentication mode used by 
      ASP.NET to identify an incoming user. 
     --> 
     <authentication mode="Windows"/> 
     <!-- 
      The <customErrors> section enables configuration 
      of what to do if/when an unhandled error occurs 
      during the execution of a request. Specifically, 
      it enables developers to configure html error pages 
      to be displayed in place of a error stack trace. 

     <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm"> 
      <error statusCode="403" redirect="NoAccess.htm" /> 
      <error statusCode="404" redirect="FileNotFound.htm" /> 
     </customErrors> 
     --> 
     <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/></system.web> 
    <!-- 
     The system.webServer section is required for running ASP.NET AJAX under Internet 
     Information Services 7.0. It is not necessary for previous version of IIS. 
    --> 
</configuration> 

感謝您的幫助!

回答

2

您必須配置您的應用程序池,以便它使用框架的4.0版本。

This procedure解釋如何做到這一點的IIS 7,和that one在IIS 6

+0

咦?我相信OP想要在4.0版本中運行他的應用程序。 – Victor 2011-02-13 15:42:14

相關問題