如何在xamarin Studio/monodevelop中为我的项目添加system.core.dll引用 [英] How do I add a system.core.dll reference to my project in xamarin studio/monodevelop

查看:98
本文介绍了如何在xamarin Studio/monodevelop中为我的项目添加system.core.dll引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正尝试使用System.Linq,因为它具有未知的解析错误".我已经做了一些关于如何做到这一点的环聊,我能找到的就是有人说需要添加它,或者他们添加了它.我想知道如何将其添加到我的项目中,以便可以使用'.ToList'函数.

I'm trying to use System.Linq because it has an 'Unknown resolve error'. I've done a bit of looking around on how to do this and all I can find is people saying that it needs to be added or that they added it. I'm wondering how to add it to my project so that I can use the '.ToList' function.

推荐答案

如果使用Xamarin Studio执行传统的iOS或Android项目,则默认情况下应已添加对System.Core的引用.

If you are doing a traditional iOS or Android project with Xamarin Studio, by default a reference to System.Core should already be added.

但是,如果您正在创建PCL,则会看到对其的引用,但是在引用"文件夹中它将显示为红色.这是因为尚未完全支持PCL.不过还是可以解决的.

However, if you're creating a PCL you will see a reference to it, but it will be red in the References folder. This is because PCLs are not fully supported yet. There is a work around though.

您可以从Mono安装中复制Core DLL,并在PCL项目中引用它.我可以在Mac上的以下位置找到该PCL: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/4.0-mscorlib.dll

You can copy the Core DLL from your Mono install and reference it in your PCL project. I was able to find this PCL on my Mac here: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/4.0 - mscorlib.dll

我通常在项目文件夹中有一个名为"DLL"的文件夹,我将这些类型的DLL和引用放入其中.

I usually have a folder called "DLLs" inside my project folder that I put these type of DLLs and reference.

希望在不久的将来,我们不必再为PCL这类黑客所困扰.

Hopefully in the near future we won't have to mess with hacks like this with PCLs.

这篇关于如何在xamarin Studio/monodevelop中为我的项目添加system.core.dll引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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