简体   繁体   English

Mac Visual Studio Xamarin-类型或名称空间“ Linq”在名称空间“系统”中不存在(您是否缺少程序集引用?)

[英]Mac Visual Studio Xamarin - the type or namespace 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?)

On Mac Visual Studio - Xamarin Project, I get an error: 在Mac Visual Studio-Xamarin Project上,出现错误:

  • the type or namespace 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference) 类型或名称空间“ Linq”在名称空间“系统”中不存在(您是否缺少程序集引用)

I have tried to resolve it by using the nuget package manager. 我试图通过使用nuget软件包管理器来解决它。 Specifically, click 'Packages' folder and click 'Add Packages...' and add Linq. 具体来说,请单击“软件包”文件夹,然后单击“添加软件包...”,然后添加Linq。 Yet it still does not find Linq when I write 'using System.Linq' yet I can see 'System.linq' in the package folder under the project. 但是,当我写“ using System.Linq”时,它仍然找不到Linq,但我仍可以在项目下的package文件夹中看到“ System.linq”。

Tried : Refresh, Update, turn off and on 尝试过:刷新,更新,关闭和打开

Why can't it find and use the package? 为什么找不到和使用包装?

Edit: For similiar error 'HttpStatusCode' where it not found under 'System.Net' yet I have the dll (Version 2.0.5.0) found. 编辑:对于类似错误“ HttpStatusCode”,在“ System.Net”下找不到,但我找到了dll(2.0.5.0版)。 I tried to install a new nuget package for it, System.Net.Primitives (Version 3.0.9.0) where 'HttpStatusCode' is stored under this new version. 我尝试为其安装一个新的nuget包System.Net.Primitives(版本3.0.9.0),其中HttpStatusCode'存储在此新版本下。 When I reference System.Net.Primitives it does not work. 当我引用System.Net.Primitives时,它不起作用。

Example: 例:

'\\ The type or namespace name 'Primitives' does not exist in the namespace 'System.Net'
Using System.Net.Primitives;
Using System.Net;
namespace code {
 public class Example
 {
  \\ the type or namespace 'HttpStatusCode' could not be found
  public HttpStatusCode HttpResponse; 
 }
}`

In one of my project I solved it by following way: 在我的一个项目中,我通过以下方式解决了该问题:

Open solution explorer. 开放式解决方案资源管理器。 Right click references, Click on assemblies, select system.xml.linq. 右键单击引用,单击程序集,然后选择system.xml.linq。

Add the reference assembly to the project. 将参考程序集添加到项目中。 Clean and rebuild. 清理并重建。 It should serve the purpose. 它应该达到目的。

Add this .nuget to your Solution. 将此.nuget添加到您的解决方案中。 Micosoft.Net.Http. Micosoft.Net.Http。 在这里检查。

您只需要将System.Core添加到您的References

暂无
暂无

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

相关问题 类型或名称空间名称在名称空间中不存在“是否缺少程序集引用?” - The type or namespace name does not exist in the namespace ''are you missing an assembly reference ?" 命名空间中不存在类型或命名空间名称(您是否缺少程序集引用?) - The type or namespace name does not exist in the namespace (are you missing an assembly reference?) 命名空间“System.Web”中不存在类型或命名空间名称“Mvc”(您是否缺少程序集引用?)Kentico - The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) Kentico 类型或名称空间“ IsolatedStorage”在名称空间“ System.IO”中不存在(您是否缺少程序集或引用?) - The type or namespace 'IsolatedStorage' does not exist in the namespace 'System.IO' (are you missing an assembly or reference?) 类型或名称空间名称“ OleDb”在名称空间“ System.Data”中不存在(您是否缺少程序集引用?) - The type or namespace name 'OleDb' does not exist in the namespace 'System.Data' (are you missing an assembly reference?) 命名空间“System.Web”中不存在类型或命名空间名称“Mvc”(您是否缺少程序集引用?) - The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) 类型或名称空间名称“ SerializableAttributeAttribute”在名称空间“系统”中不存在(您是否缺少程序集引用?) - The type or namespace name 'SerializableAttributeAttribute' does not exist in the namespace 'System' (are you missing an assembly reference?) 命名空间“System.Web.UI”中不存在类型或命名空间名称“DataVisualization”(您是否缺少程序集引用?) - The type or namespace name 'DataVisualization' does not exist in the namespace 'System.Web.UI' (are you missing an assembly reference?) 命名空间“System.Data”中不存在类型或命名空间名称“SQLite”(您是否缺少程序集引用?) - The type or namespace name 'SQLite' does not exist in the namespace 'System.Data' (are you missing an assembly reference?) 编译错误:'类型或名称空间名称'Runtime'在名称空间'MyAppNamespace.System'中不存在(您是否缺少程序集引用?)' - Compile error: 'The type or namespace name 'Runtime' does not exist in the namespace 'MyAppNamespace.System' (are you missing an assembly reference?)'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM