我刚刚将我一直在开发的 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>
谢谢您的帮助!
您必须配置应用程序池,以便它使用框架的 4.0 版本。
这个程序 http://technet.microsoft.com/en-us/library/cc754523%28WS.10%29.aspx解释了如何在 IIS 7 上执行此操作,以及that one http://www.codeproject.com/KB/server-management/VersionsDotnetFramework.aspx在 IIS 6 上。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)