在 Blazor WebAssembly 应用程序中,浏览器中下载的 .Net Framework DLL 何时转换为 webassembly?
In a Blazor WebAssembly app when do the .Net Framework DLLs downloaded in the browser get converted to webassembly?
在我的 Blazor WebAssembly 应用程序中,我可以看到 myapp.dll 和在浏览器中下载的 .Net Framework DLL,但是由于浏览器只能执行 webassembly 语言(.wasm),这些 dll 文件是转换还是在运行时按要求编译成 webassembly 语言?
在浏览器中下载的 .Net Framework DLL 永远不会转换为 webassembly。只有 Mono 运行时被编译成 WebAssembly,而你的 .Net dll 会像在 Mono 下一样执行。
One thing that sticks out in this implementation is that rather than compiling every bit of .NET code that your application runs to WASM, only the Mono Runtime is compiled as a WASM module. All of the Blazor framework and your application code is loaded as plain old .NET assemblies that are executed through Mono.
.net 二进制文件包含当前由运行时解释的 IL 代码。只有 RunTime 本身被编译为 Wasm。
口译不是最快的选择,speeding it up in the Net5 release付出了很多努力。
Blazor 对于正常的 UI 任务来说已经足够快了。但是例如,反序列化(非常)大的 JSON 消息显然比在普通 .net 中慢。
未来的运行时可以添加编译器(JIT 或 AOT)。我们将不得不等待。
在我的 Blazor WebAssembly 应用程序中,我可以看到 myapp.dll 和在浏览器中下载的 .Net Framework DLL,但是由于浏览器只能执行 webassembly 语言(.wasm),这些 dll 文件是转换还是在运行时按要求编译成 webassembly 语言?
在浏览器中下载的 .Net Framework DLL 永远不会转换为 webassembly。只有 Mono 运行时被编译成 WebAssembly,而你的 .Net dll 会像在 Mono 下一样执行。
One thing that sticks out in this implementation is that rather than compiling every bit of .NET code that your application runs to WASM, only the Mono Runtime is compiled as a WASM module. All of the Blazor framework and your application code is loaded as plain old .NET assemblies that are executed through Mono.
.net 二进制文件包含当前由运行时解释的 IL 代码。只有 RunTime 本身被编译为 Wasm。
口译不是最快的选择,speeding it up in the Net5 release付出了很多努力。
Blazor 对于正常的 UI 任务来说已经足够快了。但是例如,反序列化(非常)大的 JSON 消息显然比在普通 .net 中慢。
未来的运行时可以添加编译器(JIT 或 AOT)。我们将不得不等待。