简体   繁体   English

无法解析System.Web.Extensions程序集

[英]System.Web.Extensions Assembly cannot be resolved

I am trying to run a .NET 4.0 Console application that references a sister library project (Bar.dll) which itself references System.Web.Extensions in VS2010 B2. 我正在尝试运行引用姐妹库项目(Bar.dll)的.NET 4.0控制台应用程序,该项目本身引用VS2010 B2中的System.Web.Extensions。 I am currently only interested in getting access to System.Web.Scripting.JavaScriptSerializer . 我目前只对访问System.Web.Scripting.JavaScriptSerializer感兴趣。

Both projects have references to System.Web.Extensions (using the one listed under ".NET" in the App References dialog), but when I try to compile/run the application, the compiler barks: 这两个项目都引用了System.Web.Extensions(使用App References对话框中“.NET”下面列出的那个),但是当我尝试编译/运行应用程序时,编译器咆哮:

C:\Windows\Microsoft.NET\Framework\v4.0.21006\Microsoft.Common.targets(1291,9):
warning MSB3253: The referenced assembly "Bar.dll" could not be resolved because it has a dependency on 
"System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client".

Seriously? 真的吗? What's going on? 这是怎么回事? Why won't the compiler link with the assembly? 为什么编译器不会与程序集链接?

currently targeted framework ".NETFramework,Version=v4.0,Profile=Client".
                                                         ^^^^^^^^^^^^^^

You're targeting the Client Profile, which doesn't include the Web assemblies. 您的目标是客户端配置文件,其中不包含Web程序集。 Go into Project > Properties > Application and change Target Framework to ".NET Framework 4". 进入Project> Properties> Application并将Target Framework更改为“.NET Framework 4”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法使用system.web.extensions托管网站 - Cannot host website with system.web.extensions 我在哪里可以找到程序集 System.Web.Extensions dll? - Where can I find the assembly System.Web.Extensions dll? 无法加载文件或程序集“ System.Web.Extensions” - Could not load file or assembly 'System.Web.Extensions' 无法添加System.Web.Extensions程序集作为参考 - can not add System.Web.Extensions Assembly as reference System.Web.Extensions的用途是什么? - What is System.Web.Extensions for? 无法将System.Web.Extensions应用于PartialTrustVisibleAssemblies列表 - Cannot Apply System.Web.Extensions to PartialTrustVisibleAssemblies List C#Framework 4.5不包含System.Web.Extensions - c# framework 4.5 not include System.Web.Extensions 如何添加 System.Web.Extensions 以使 JavaScriptSerializer 工作 - How to add System.Web.Extensions to get JavaScriptSerializer work 无法加载文件或程序集“System.Web.Extensions,版本=4.0.0.0,文化=中性,PublicKeyToken=31bf3856ad364e35” - Could not load file or assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' 我是否需要web.config值配置 - >运行时 - > System.Web.Extensions的assemblyBinding? - Do I need the web.config values configuration -> runtime -> assemblyBinding for System.Web.Extensions?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM