How to use .NET Core 2.0 ilasm.exe?

隐身守侯 提交于 2019-12-13 16:17:18

问题


I'm trying https://www.nuget.org/packages/runtime.win-x64.Microsoft.NETCore.ILAsm/ (upon Where is ilasm.exe in Microsoft.NETCore.ILAsm?) on a Win 10 Pro x64 PC. Nothing happens.

Whatever syntax I'm using, still nothing. E.g. no .dll is generated from my input and nothing is printed in the console.

Even if I just run "ilasm" (no parameters), no output is produced. It remains completely silent. At the same time, if I run older C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\ilasm.exe, it always produces some output (for instance, parameter usage reference).

How am I supposed to use this latest ilasm.exe for .NET Core 2.0? Does it have different command line arguments? Or, maybe, I need some additional files for it to work (although the package didn't have anything meaningful but ilasm.exe itself)?


回答1:


The .NET Core variants of ILAsm and ILDasm depend on core assets of the build of the same CoreCLR version they are built for. If they are restored via a dependency graph, a self-contained .net core deployment depending on Microsoft.NETCore.ILAsm should contain all assets for the target runtime.

To get the extracted version of ilasm.exe / ildasm.exe to work without doing that, you need to copy the coreclr.dll from the matching .net core version into the same directory. This file can be found in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.0.0 if a .NET Core 2.0.0 runtime is installed in its default location.



来源:https://stackoverflow.com/questions/45820147/how-to-use-net-core-2-0-ilasm-exe

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!