与 Microsoft .Net 实现相比,有一些 P/Invoke 扩展(毕竟它们处理的是单一操作系统系列和最多三种架构)。 其中最值得注意的是库映射将库名称转换为特定于操作系统的变体(例如,mylib.dll 在 Linux 上搜索 mylib.so,mylib.dll 搜索 mylib.so)。 dylib on OS X 等)并考虑各种其他系统特定约定。 还有一个 DLLMap 配置扩展,如果默认名称翻译不够,可以使用它。 通常,在不同操作系统上公开相同的二进制库 API 会很方便,因此平台之间的迁移只需要更改 C 代码,而不需要更改 .Net 部分。
Working, usable and stable. It's well tested since quite a lot of mono's own low-level functionality has to be marshaled through it to the underlying operating system.
There are some P/Invoke extensions when compared to Microsoft .Net implementation (after all they deal with a single OS family and three architectures at most). Most notable of those would be that library mappings transform the library name to OS-specific variants (e.g. mylib.dll searches for mylib.so on Linux, mylib.dylib on OS X and so on) and take into account various other system specific conventions. There is also a DLLMap configuration extension which can be used if the default name translations are not enough. Usually it's convenient to have the same API of the binary lib exposed on different OSes, so that migrating between platforms only requires changes in the C code, not the .Net part.
发布评论
评论(1)
工作、可用且稳定。 它经过了充分的测试,因为相当多的 mono 自己的低级功能必须通过它编组到底层操作系统。
与 Microsoft .Net 实现相比,有一些 P/Invoke 扩展(毕竟它们处理的是单一操作系统系列和最多三种架构)。 其中最值得注意的是库映射将库名称转换为特定于操作系统的变体(例如,
mylib.dll
在 Linux 上搜索mylib.so
,mylib.dll 搜索
on OS X 等)并考虑各种其他系统特定约定。 还有一个 DLLMap 配置扩展,如果默认名称翻译不够,可以使用它。 通常,在不同操作系统上公开相同的二进制库 API 会很方便,因此平台之间的迁移只需要更改 C 代码,而不需要更改 .Net 部分。mylib.so
)。 dylibWorking, usable and stable. It's well tested since quite a lot of mono's own low-level functionality has to be marshaled through it to the underlying operating system.
There are some P/Invoke extensions when compared to Microsoft .Net implementation (after all they deal with a single OS family and three architectures at most). Most notable of those would be that library mappings transform the library name to OS-specific variants (e.g.
mylib.dll
searches formylib.so
on Linux,mylib.dylib
on OS X and so on) and take into account various other system specific conventions. There is also a DLLMap configuration extension which can be used if the default name translations are not enough. Usually it's convenient to have the same API of the binary lib exposed on different OSes, so that migrating between platforms only requires changes in the C code, not the .Net part.