Search code examples
blazorwebassemblyblazor-webassembly.net-6.0

why there is no .wasm file generated for blazor webasesembly with AOT compilling enabled?


I just tried the new blazor webassembly framework, and there is one thing I cann't understand that:

I have published the project with AOT enabled. But still, in the published files, I can not see any .wasm files except the "dotnet.wasm" file.

From what I've learned https://visualstudiomagazine.com/articles/2021/05/26/net6-aspnet.aspx , all c# code as well as the BCL dlls are AOTed to .wasm. Please point me out what I've missed? Or can you maybe give me an idea how the blazor webassembly AOT works in this case?

Thank you very much.


Solution

  • All C#(technically IL) code is compiled to dotnet.wasm file now. You can notice that the size of this file is significantly bigger compared to non-AOT version. For instance, when you publish without AOT, the size of dotnet.wasm is 2MB, however, with AOT it can be 50 or even more MB.