Mono 中的系统数据

发布于 2024-08-10 21:09:32 字数 455 浏览 6 评论 0原文

Mono 中的 System.Data 是否已扩展以包含额外的功能? 我试图在 Mono.Data.SqlExpressions 中使用为 Mono 编写的 SQL 解析器,但是当包含 SqlExpressions 命名空间中的所有类时,该项目仍然无法编译,因为 System.Data 中的类不匹配。< br> 例如,System.Data.DataColumn 没有定义PropertyChanged 事件。 我需要使用 Mono System.Data 库吗? 当项目中包含 Mono DataColumn 类时,不会发生此编译错误(它引用了 DataCategory 等类,这些类在 .Net 框架中找不到)。

或者,如果您能提供有关如何将 Mono 中的 Sql 解析器移植到 Microsoft 的 .Net 框架的任何帮助,我们将不胜感激。我尝试下载源代码并将缺少的库添加到项目中,但这种方法似乎有缺陷。缺少的依赖项的数量似乎增加了,而不是解决了问题。

Has System.Data in Mono been expanded to include extra functionality?
I'm attempting to make use of the SQL Parser written for Mono in Mono.Data.SqlExpressions but when all the classes in the SqlExpressions namespace have been included the project still fails to compile because the classes in System.Data do not match.
Example, System.Data.DataColumn does not define the PropertyChanged event.
Will I need to use the Mono System.Data libraries instead?
When the Mono DataColumn class is included in the project this compilation error does not occur (it references classes such as DataCategory, which aren't found in the .Net framework).

Alternatively, any help on how to port the Sql Parser in Mono to Microsoft's .Net framework would be appreciated. I have attempted to download the source and add the missing libraries to the project but this approach appears flawed. The number of missing dependencies seems to increase instead of resolving the issue.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

日裸衫吸 2024-08-17 21:09:32

Mono 试图与 MS 的实现实现二进制和 API 兼容。这意味着除了一些内部支持方法和类之外,Mono 公开的所有 API 都应该与 MS .Net 的 101 匹配。这是为了避免复杂化,就像人们假设一个方法存在一样,因为它在 Mono 中编译,但它毕竟在 MS.Net 上不起作用。

当 Mono 贡献者实现新代码和功能时,通常会将其合并到单独的程序集和项目中。 Mono.Data 顾名思义就是这样一个“扩展”,因此您需要包含所有依赖程序集才能构建它是有意义的。 Mono.Data.dll 及其依赖项是否可以在 MS.Net 上运行,这只是检查文档并进行测试的问题。

至于你的第二个问题,我无法告诉你具体细节,但除非代码有在 Windows 上运行的特定指令,否则很可能需要大量工作来移植。与任何 API 一样,许多代码不会暴露给公共接口,并且在移植代码时需要解决实现的内部功能。我建议您花一些时间分析代码的工作原理,然后尝试通过删除 Mono 代码上尽可能多的依赖使其在 MS.Net 上运行。最后,如果代码足够兼容,您应该考虑使用编译指令和 #if !MONO 编译指令来修补 Mono 的源代码,以避免给未来用户带来麻烦。

Mono tried to be binary and API compatible with MS's implementation. That means that except for a few internal support methods and classes, all the APIs exposed by Mono should match 101 with MS .Net's. This is to avoid complication like people assuming a method exists because it compiles in Mono and then it doesn't work on MS.Net after all.

When new code and features are implemented by Mono contributors it's usually incorporated in a separate assembly and project. Mono.Data as the name suggests is such an "extension" so it makes sense you need to include all the dependent assemblies to be able to build it. If Mono.Data.dll and its deps will run on MS.Net or not its a matter or checking the docs and testing it.

As for you second question, I can't tell you specifics but unless the code has specific intructions to be run on Windows it will most likely require a lot of work to port. As with any API a lot of code isn't exposed to the public interfaces and internal features of the implementation need to be worked around when porting the code. I would suggest you take sometime analysing how the code works and then try to make it run on MS.Net by removing as much deps on Mono code as it makes sense. In the end if the code is compatible enough you should consider patching Mono's source with compilation intructions and #if !MONO pragmas to save the trouble to future users.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文