可用程序集Available Assemblies

Xamarin、Xamarin 和 Xamarin 均随附了数十个程序集。Xamarin.iOS, Xamarin.Android, and Xamarin.Mac all ship with over a dozen assemblies. 正如 Silverlight 是桌面 .NET 程序集的扩展子集,Xamarin 平台也是多个 Silverlight 和桌面 .NET 程序集的扩展子集。Just as Silverlight is an extended subset of the desktop .NET assemblies, Xamarin platforms is also an extended subset of several Silverlight and desktop .NET assemblies.

Xamarin 平台与为不同配置文件编译的现有程序集不兼容。Xamarin platforms are not ABI compatible with existing assemblies compiled for a different profile. 您必须重新编译源代码,以生成以正确配置文件为目标的程序集(就像您需要将源代码重新编译为面向 Silverlight 和 .NET 3.5 的情况一样)。You must recompile your source code to generate assemblies targeting the correct profile (just as you need to recompile source code to target Silverlight and .NET 3.5 separately).

Xamarin 应用程序可以在三种模式下进行编译:一个使用 Xamarin 的特选移动配置文件,一个 Xamarin .NET 4.5 Framework,它允许您将现有的完整桌面程序集作为目标,而不支持使用在系统 Mono 中找到的 .NET API安装.Xamarin.Mac applications can be compiled in three modes: one that uses Xamarin's curated Mobile Profile, the Xamarin.Mac .NET 4.5 Framework which allows you target existing full desktop assemblies, and an unsupported one that uses the .NET API found in a system Mono installation. 有关详细信息,请参阅我们的目标框架文档。For more information, please see our Target Frameworks documentation.

.NET Standard 库.NET Standard Libraries

除了 iOS、Android 和 Mac 绑定外,Xamarin 项目还可以使用.NET Standard 库In addition to the iOS, Android, and Mac bindings, Xamarin projects can consume .NET Standard libraries.

可移植类库Portable Class Libraries

Xamarin 项目还可以使用.Net 可移植类库,不过,这种技术在支持 .NET Standard 时是不推荐使用的。Xamarin projects can also consume .NET Portable Class Libraries, although this technology is being deprecated in favor of .NET Standard.

支持的程序集Supported Assemblies

这些是在引用管理 > 器中可用的程序集 > 框架(Visual Studio 2017)和编辑引用 > 包(Visual Studio for Mac)以及它们与 Xamarin 平台的兼容性。These are the assemblies available in the Reference Manager > Assemblies > Framework (Visual Studio 2017) and Edit References > Packages (Visual Studio for Mac), and their compatibility with Xamarin platforms.

AssemblyAssembly API 兼容性API Compatibility Xamarin iOSXamarin iOS Xamarin AndroidXamarin Android Xamarin MacXamarin Mac
FSharp.Core.dllFSharp.Core.dll
l18Nl18N.dll 包括 CJK、MidEast、其他、罕见、西Includes CJK, MidEast, Other, Rare, West
Microsoft.CSharp.dllMicrosoft.CSharp.dll
Mono.CSharp.dllMono.CSharp.dll
Mono.Data.Sqlite.dllMono.Data.Sqlite.dll SQLite 的 ADO.NET 提供程序;请参阅限制。ADO.NET provider for SQLite; see limitations.
Mono.Data.Tds.dllMono.Data.Tds.dll TDS 协议支持;用于system.web中的SqlClient支持。TDS Protocol support; used for System.Data.SqlClient support within System.Data.
Mono。​解释器 .dllMono.Dynamic.​Interpreter.dll
Mono.Security.dllMono.Security.dll 加密 Api。Cryptographic APIs.
monotouch.dllmonotouch.dll 此程序集包含C# CocoaTouch API 的绑定。This assembly contains the C# binding to the CocoaTouch API. 这仅适用于经典 iOS 项目。This is only available within Classic iOS Projects.
Monotouch.dialog.​Dialog-1MonoTouch.​Dialog-1.dll
Monotouch.dialog.​NUnitLiteMonoTouch.​NUnitLite.dll
mscorlib.dllmscorlib.dll SilverlightSilverlight
OpenTK-1.0.dllOpenTK-1.0.dll 面向 OpenGL/OpenAL 对象的 Api,扩展以提供 iPhone 设备支持。The OpenGL/OpenAL object oriented APIs, extended to provide iPhone device support.
System.dllSystem.dll Silverlight,外加以下命名空间中的类型:Silverlight, plus types from the following namespaces:
System.Collections.SpecializedSystem.Collections.Specialized
主板.​System.componentmodelSystem.​ComponentModel
System.componentmodelSystem.ComponentModel.Design
System.DiagnosticsSystem.Diagnostics
System.IOSystem.IO
System.IO.CompressionSystem.IO.Compression
System.IO.Compression.FileSystemSystem.IO.Compression.FileSystem
System.NetSystem.Net
系统 .Net. 缓存System.Net.Cache
System.Net.MailSystem.Net.Mail
系统 .NetSystem.Net.Mime
System.Net。​System.net.networkinformationSystem.Net.​NetworkInformation
System.Net.SecuritySystem.Net.Security
System.Net.SocketsSystem.Net.Sockets
System.object。​InteropServicesSystem.Runtime.​InteropServices
System.Runtime.VersioningSystem.Runtime.Versioning
系统安全。​Accesscontrol-namespaceSystem.Security.​AccessControl
System.Security.AuthenticationSystem.Security.Authentication
系统安全。​加密System.Security.​Cryptography
System.Security.PermissionsSystem.Security.Permissions
System.ThreadingSystem.Threading
系统定时器System.Timers
主板.​System.componentmodel。​组合 .dllSystem.​ComponentModel.​Composition.dll
主板.​System.componentmodel。​DataAnnotationsSystem.​ComponentModel.​DataAnnotations.dll
System.Core.dllSystem.Core.dll SilverlightSilverlight
System.Data.dllSystem.Data.dll .Net 3.5移除了某些功能.NET 3.5 , with some functionality removed.
System.object。​服务。​Client .dllSystem.Data.​Services.​Client.dll 完整的 oData 客户端。Full oData client.
System.IO。​压缩System.IO.​Compression
System.IO。​压缩。​文件系统System.IO.​Compression.​FileSystem
System.Json.dllSystem.Json.dll SilverlightSilverlight
System.Net。​Http.sysSystem.Net.​Http.dll
主板.​数值型 .dllSystem.​Numerics.dll
System.object。​序列化 .dllSystem.Runtime.​Serialization.dll SilverlightSilverlight
主板.​System.servicemodel .dllSystem.​ServiceModel.dll Silverlight中存在的 WCF 堆栈WCF stack as present in Silverlight
主板.​一起。​内部 .dllSystem.​ServiceModel.​Internals.dll
主板.​一起。​Web.configSystem.​ServiceModel.​Web.dll Silverlight,外加以下命名空间中的类型:Silverlight, plus types from the following namespaces:
SystemSystem
System.ServiceModel.ChannelsSystem.ServiceModel.Channels
System.ServiceModel.DescriptionSystem.ServiceModel.Description
System.ServiceModel.WebSystem.ServiceModel.Web
主板.​事务 .dllSystem.​Transactions.dll .Net 3.5;系统支持的一部分。.NET 3.5; part of System.Data support.
System.web。​服务 .dllSystem.Web.​Services.dll .NET 3.5 配置文件中的基本 Web 服务,其中删除了服务器功能。Basic Web services from the .NET 3.5 profile, with the server features removed.
主板.​Windows .dllSystem.​Windows.dll
主板.​Xml .dllSystem.​Xml.dll .NET 3.5.NET 3.5
System.object。​Linq .dllSystem.Xml.​Linq.dll .NET 3.5.NET 3.5
System.Xml.Serialization.dllSystem.Xml.Serialization.dll
Xamarin.iOS.dllXamarin.iOS.dll 此程序集包含C# CocoaTouch API 的绑定。This assembly contains the C# binding to the CocoaTouch API. 这仅用于统一 iOS 项目。This is only used in Unified iOS Projects.
Java.Interop.dllJava.Interop.dll
Mono.Android.dllMono.Android.dll
Mono。​导出 .dllMono.Android.​Export.dll
Mono.Posix.dllMono.Posix.dll
主板.​System.enterpriseservices.servicedcomponentSystem.​EnterpriseServices.dll
Xamarin。​NUnitLiteXamarin.Android.​NUnitLite.dll
System.runtime.compilerservices。​SymbolWriterMono.CompilerServices.​SymbolWriter.dll 适用于编译器编写器。For compiler writers.
Xamarin.Mac.dllXamarin.Mac.dll
主板.​制图System.​Drawing.dll 在 Unified API 中,不支持 Xamarin、.NET 4.5 或移动框架。System.Drawing is not supported in the Unified API for the Xamarin.Mac, .NET 4.5, or Mobile frameworks. 使用sysdrawing-coregraphics库可以将绘图支持添加到 IOS 和 macOSSystem.Drawing support can be added to iOS and macOS using the sysdrawing-coregraphics library