MonoDroid和MonoTouch中的可移植类库程序集参考问题 [英] Portable Class Library assembly reference problems in MonoDroid and MonoTouch
问题描述
当我尝试构建参考了PCL错误的MonoDroid或MonoTouch项目时,我的项目中存在用于.Net 4.5,Windows Phone 8,WinRT,MonoTouch和MonoDroid的PCL,我遇到了问题:
I have problem in my project where I have PCL for .Net 4.5, Windows Phone 8, WinRT, MonoTouch and MonoDroid, when I try to build MonoDroid or MonoTouch project that have reference to that PCL errors are following:
*错误1类型'System.Object'是在未引用的程序集中定义的.您必须添加对程序集'System.Runtime的引用, 版本= 4.0.0.0,文化=中性,PublicKeyToken = b03f5f7f11d50a3a'.
*Error 1 The type 'System.Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
错误2类型'System.Enum'是在不是 参考.您必须添加对程序集'System.Runtime的引用, 版本= 4.0.0.0,文化=中性,PublicKeyToken = b03f5f7f11d50a3a'.
Error 2 The type 'System.Enum' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
我已经完成了建议命令(sn -Vr *,b03f5f7f11d50a3a),但这没有帮助.我正在使用以下配置文件:
I have done suggested command (sn -Vr *,b03f5f7f11d50a3a), but it didn't help. I am using the following profile:
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile78
推荐答案
如果将兼容性设置为从.NET 4.5到.NET 4.0.3,则它将起作用.
If you set the compability to from .NET 4.5 to .NET 4.0.3 it will work.
这篇关于MonoDroid和MonoTouch中的可移植类库程序集参考问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!