【发布时间】:2011-02-13 14:25:53
【问题描述】:
我刚刚将我一直在开发的一个 asp.net Web 应用程序部署到一台新的开发机器上。这是一个从 3.5 转换而来的 4.0 项目。出于某种原因,当我尝试通过默认网站下的 IIS 网站访问该网站时出现以下错误:
无法识别的属性“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>
感谢您的帮助!
【问题讨论】:
标签: iis web-config asp.net-4.0