且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

.Net Core是否生成与标准.Net相同的IL?

更新时间:2023-02-09 08:15:19

是的,它会生成相同的IL

Yes it generates the same IL

(我不能这么简单地回答它)

(I could not resist to answer it that simple)

不过,对于VB部分:关于VB支持:在.NET Core上运行需要编译器(在Roslyn中实现),CLI命令 dotnet-compile-vb (尚未为F#实施……目前社区已交付它)和受支持的 Microsoft.VisualBasic 版本(在corefx中实现)。我猜想VisualBasic支持的要点与例如ASP.NET SignalR。该代码在那里运行的是95%,但尚未经过官方测试和支持。

Nevertheless, to the VB Part: In regards of VB support: Running on .NET Core requires a compiler (implemented in Roslyn), a CLI command dotnet-compile-vb (not implemented ... for F# the community delivered it by now) and a supported version of Microsoft.VisualBasic (implemented in corefx). I guess the point of VisualBasic support is the same as for e.g. ASP.NET SignalR. The code is 95% there, it runs, but it is not officially tested and supported. It is a matter of timelines not of technologies.

恕我直言:考虑到 Microsoft.VisualBasic 组件在那里, IL是相同的,只要编译器使用基于System.Runtime的Core平台,理论上它甚至可以执行已编译的VB程序集。

IMHO: Considering that the Microsoft.VisualBasic assembly is there and the IL is the same, it could in theory even execute a compiled VB assembly as long as the compiler used the System.Runtime based Core platform.

PS May 2019:他们刚刚宣布要移植大部分VB .NET运行时

PS May 2019: they just announced to Port the majority of the VB .NET Runtime