The type or namespace name 'Linq' does not exist in the namespace 'System'

后端 未结 10 683
我在风中等你
我在风中等你 2020-12-10 01:02

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:


        
          


        
相关标签:
10条回答
  • 2020-12-10 01:45

    Solution: It seems that the web config should be:

    <system.web>
        <compilation debug="true" targetFramework="4.0"/>
    </system.web>
    
    0 讨论(0)
  • 2020-12-10 01:47

    I had the same error but my web app was running on framework v2.0. Changed my application pool from v2.0 to v4.0. all working...happy days

    0 讨论(0)
  • 2020-12-10 01:50

    Another thing to check is is your .csproj file, specifically these items:

    <TargetFrameworkProfile>Profile47</TargetFrameworkProfile>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    

    If you don't have a folder for the Profile indicated, you might need to manually change it to one you do have. You might also be able to download the target from https://www.microsoft.com/net/download/visual-studio-sdks.

    Unfortunately, my colleague had this happen with an old-style PCL project (profile-based PCL), so he wasn't able to go download the .NET Portable target, but I had to give him the DLLs out of my functioning folder (C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETPortable\v4.0\Profile\Profile47).

    0 讨论(0)
  • 2020-12-10 01:52

    Deleting the hidden .vs folder and restarting Visual Studio fixed it for me.

    0 讨论(0)
提交回复
热议问题