如何使用 .NET Core 2.0 ilasm.exe? [英] How to use .NET Core 2.0 ilasm.exe?

查看:20
本文介绍了如何使用 .NET Core 2.0 ilasm.exe?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试 https://www.nuget.org/packages/runtime.win-x64.Microsoft.NETCore.ILAsm/(基于 在 Microsoft.NETCore.ILAsm 中 ilasm.exe 在哪里?)在 Win 10 Pro x64 PC 上.什么都没发生.

无论我使用什么语法,仍然什么都没有.例如.我的输入没有生成 .dll,控制台也没有打印任何内容.

即使我只运行ilasm"(无参数),也不会产生任何输出.它保持完全沉默.同时,如果我运行较旧的 C:WINDOWSMicrosoft.NETFramework64v4.0.30319ilasm.exe,它总是会产生一些输出(例如,参数用法参考).

我应该如何将这个最新的 ilasm.exe 用于 .NET Core 2.0?它有不同的命令行参数吗?或者,也许,我需要一些额外的文件才能使其工作(尽管该包没有任何有意义的东西,但 ilasm.exe 本身)?

解决方案

ILAsm 和 ILDasm 的 .NET Core 变体依赖于构建它们的相同 CoreCLR 版本的核心资产.如果它们通过依赖关系图恢复,则依赖于 Microsoft.NETCore.ILAsm 的自包含 .net 核心部署应包含目标运行时的所有资产.

要使ilasm.exe/ildasm.exe 的提取版本在不这样做的情况下工作,您需要复制coreclr.dll 从匹配的 .net 核心版本到同一目录.如果 .NET Core 2.0.0 运行时安装在其默认位置,则可以在 C:Program FilesdotnetsharedMicrosoft.NETCore.App2.0.0 中找到此文件.>

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:WINDOWSMicrosoft.NETFramework64v4.0.30319ilasm.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)?

解决方案

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 FilesdotnetsharedMicrosoft.NETCore.App2.0.0 if a .NET Core 2.0.0 runtime is installed in its default location.

这篇关于如何使用 .NET Core 2.0 ilasm.exe?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆