问题描述
我正在尝试(基于)。没什么事。
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.
无论我使用什么语法,仍然一无所有。例如。输入的内容不会生成.dll,控制台中也不会打印任何内容。
Whatever syntax I'm using, still nothing. E.g. no .dll is generated from my input and nothing is printed in the console.
即使我只是运行 ilasm(无参数),也不会产生任何输出。它仍然完全保持沉默。同时,如果我运行较旧的C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\ilasm.exe,它将始终产生一些输出(例如,参数用法参考)。
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).
我应该如何将最新的ilasm.exe用于.NET Core 2.0?它有不同的命令行参数吗?或者,也许,我需要一些其他文件才能工作(尽管该软件包除了ilasm.exe本身没有任何意义)?
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)?
推荐答案
ILAsm和ILDasm的.NET Core变体取决于为其构建相同CoreCLR版本的构建的核心资产。如果通过依赖关系图还原它们,则依赖于 Microsoft.NETCore.ILAsm
的自包含.net核心部署应包含目标运行时的所有资产。
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.
获取 ilasm.exe
/ ildasm.exe
的提取版本若要不执行此操作,您需要将 coreclr.dll
从匹配的.net核心版本复制到同一目录中。如果是.NET Core 2.0,可以在 C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.0.0
中找到此文件。默认位置安装了0个运行时。
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.
这篇关于如何使用.NET Core 2.0 ilasm.exe?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!