ASP.NET Web App使用错误的(2.0)CLR版本(而不是4.0) [英] ASP.NET Web App using the wrong (2.0) CLR version (instead of 4.0)

查看:137
本文介绍了ASP.NET Web App使用错误的(2.0)CLR版本(而不是4.0)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚部署了一个asp.net网络应用程序,我一直致力于新的开发机器。这是一个从3.5转换而来的4.0项目。出于某种原因,当我尝试通过我的IIS网站在默认网站下访问网站时出现以下错误:

I just deployed an asp.net web app I have been working on to a new dev machine. It's a 4.0 project converted from 3.5. For some reason, I get the following error when I try to hit the site via my IIS website under the Default Website:


无法识别的属性' targetFramework。请注意,属性名称区分大小写。

Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.

它将此列为ASP.NET错误页面上的配置错误:

It lists this as being a config error on the ASP.NET error page:

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

但是,我注意到在错误页面的底部,版本信息表明它正在使用版本2而不是版本4.任何人都有关于如何解决此问题的想法?

However, I notice that at the bottom of the error page, the version information indicates that it is using version 2 instead of version 4. Anyone have ideas about how to fix this?

我确保我的默认网站使用.net 4 /集成应用程序池和我在进行此更改后循环使用iis。仍然没有运气。这是我的整个web.config文件:

I have made sure that my default website usese a .net 4 / integrated app pool and i cycled iis after this change was made. Still not luck. Here is my entire web.config file:

    <?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版。

You have to configure your application pool so it uses version 4.0 of the framework.

此过程说明了如何在IIS 7上执行此操作,以及 IIS 6上的那个

This procedure explains how to do it on IIS 7, and that one on IIS 6.

这篇关于ASP.NET Web App使用错误的(2.0)CLR版本(而不是4.0)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆