命名空间“System"中不存在类型或命名空间名称“Linq" [英] The type or namespace name 'Linq' does not exist in the namespace 'System'

查看:55
本文介绍了命名空间“System"中不存在类型或命名空间名称“Linq"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 IIS 的网站中托管了一个 wcf 服务,但我似乎遇到了这个问题.在我的 web.config 我有这个:

I have a wcf service hosted in a website in IIS and I seem to have this issue. In my web.config I have this:

<system.web>
        <compilation>
            <assemblies>
                <add assembly="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add assembly="System.Data.DataSetExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies>
        </compilation>
    </system.web>

解决方案目标框架 4.0 中的所有项目.

All projects in the solution target framework 4.0.

LE:当我尝试导入 System.Linq 时出现错误;

LE: I get the error when I try to import System.Linq;

 using System.Linq;

推荐答案

解决方案:看来 web config 应该是:

Solution: It seems that the web config should be:

<system.web>
    <compilation debug="true" targetFramework="4.0"/>
</system.web>

这篇关于命名空间“System"中不存在类型或命名空间名称“Linq"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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