小编Rob*_*bix的帖子

在 Linux 上运行 uno WebAssembly 时出现 SecurityException“ECall 方法必须打包到系统模块中”

在我们的设置中,我们在嵌入式 Linux 目标上运行 .net 5 应用程序。将来我们可能想在 Windows 系统上运行它。对于用户界面,我们正在评估 uno 平台。因为我们希望用户界面可以远程使用,所以我尝试在目标上运行 uno web assembly。

我已经在 VS Code 中创建了项目,如https://platform.uno/docs/articles/get-started-vscode.html中所述。该应用程序按照网站上的描述在本地运行。Program.cs 是

using System;
using Windows.UI.Xaml;

namespace Terminal.Uno.Wasm
{
    public class Program
    {
        private static App _app;

        static int Main(string[] args)
        {
            Windows.UI.Xaml.Application.Start(_ => _app = new App());

            return 0;
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

我已经更新了用于远程部署和调试的 json 文件。这有效,应用程序启动并且调试器将自身定位在入口点上。

一旦我执行 Main 的第一行,我就会得到异常

Unhandled exception. System.Security.SecurityException: ECall methods must be packaged into a system module.
   at WebAssembly.Runtime.NetCoreInvokeJS(String str, Int32& exceptionResult)
   at WebAssembly.Runtime.InvokeJS(String str)
   at Uno.Foundation.WebAssemblyRuntime.InnerInvokeJS(String str) …
Run Code Online (Sandbox Code Playgroud)

webassembly uno-platform

5
推荐指数
0
解决办法
712
查看次数

标签 统计

uno-platform ×1

webassembly ×1