将现有的 C# 代码编译为 WebAssembly

Compiling existing C# code to WebAssembly

是否可以将现有的 C# 代码编译为 WebAssembly (.wasm),从而无需或几乎无需更改代码?
我必须为此使用 Blazor 还是他们的其他可能性?

Is it possible to compile existing C# code to WebAssembly (.wasm)

不,(还)没有编译器。但是

so that no or nearly no code changes have to be done?

这很简单,您只需将 .net DLL(程序包)添加到您的项目中即可。
只需确保代码在浏览器中有意义,即没有线程,没有 I/O 除了 HttpClient 等

Do I have to use Blazor for it or are their other possibilities?

目前只有 Blazor。