Cordova 插件可以调用 .Net Framework .dll 吗?不是 WinRT 组件(.Net Core)?

Can a Cordova plugin make calls to a .Net Framework .dll?? Not WinRT Component (.Net Core)?

我有一个针对 .NET Framework 编写的 .dll。我需要创建一个可以调用此 .dll 的 Cordova 插件。

我们的 Cordova 应用程序在 Windows 10 平板电脑上运行。

因为此 .dll 以 .NET Framework 而不是 .NetCORE 为目标,所以我无法采用我所见过的所有指南中建议的 WinRT 组件方法。

是否可以使用调用 .NET Framework .dll 的 Cordova 插件?如果可以,您能否推荐一种正确的方法?

免责声明:我在 Cordova 的杂草中。我边走边学。一个例子将不胜感激。

谢谢

Apache Cordova is a platform for building native mobile applications using HTML, CSS and JavaScript

所以不,您不能直接在客户端上调用 .NET 程序集。您必须将它们放在 plugin. You can find some samples for Windows Phone here. Another sample in this SO question.

形式和功能都没有。您需要使用适用于 UWP 的 .Net Core 的 .Net 库。

表格: UWP 运行 上的 Cordova 应用在原生 JavaScript 环境中,而不是在 C# 应用中托管的 WebView 中。 UWP JavaScript 应用程序调用 .Net 函数的唯一方法是通过 Windows 运行时组件 (WRC)。

虽然您可以(理论上)为使用 .Net 托管 WebView 的 Windows 运行时编写一个 Cordova 版本,但我不知道有任何现有版本。 (Hassan Ali 链接的 Windows Phone 8 版本确实使用了 Silverlight WebBrowserControl,但 运行 在 Windows 10 平板电脑上没有使用。

函数: 即使您将 Cordova 主机更改为 .Net,它也可以直接调用 .Net 而无需 WRC,在 UWP 上下文中仍然 运行。

UWP 应用只能使用 NetCore,不能使用完整的 .Net Framework,无论它们是直接的 .Net 应用还是在 WRC 中调用 .Net。