我在我的Ubuntu18.04上安装了ildasm
nuget install Microsoft.NETCore.ILDAsm
我最终得到了两个目录:
/home/vagrant/.nuget/packages/microsoft.netcore.ildasm/2.0.8/
/home/vagrant/Microsoft.NETCore.ILDAsm.2.0.8/
但它们中没有一个包含任何dll或exe:
vagrant@ubuntu1804:~/Microsoft.NETCore.ILDAsm.2.0.8$ ls
LICENSE.TXT Microsoft.NETCore.ILDAsm.2.0.8.nupkg
Microsoft.NETCore.ILDAsm.nuspec _rels runtime.json THIRD-PARTY-NOTICES.TXT
version.txt
nuget将主要应用程序放在哪里,即与Windows上的ildasm.exe等效的应用程序?
还是我做错了什么在Linux上安装ildasm?
发布于 2020-12-29 02:28:50
让我们考虑安装ildasm的两种方法。
使用nuget包的
dotnet --info
# execution result
..
Runtime Environment:
OS Name: ubuntu
OS Version: 18.04
OS Platform: Linux
RID: ubuntu.18.04-x64 # <----
..
chmod +x ildasm
sudo mv ildasm /usr/share/dotnet/shared/Microsoft.NETCore.App/{version}/
ln -s /usr/share/dotnet/shared/Microsoft.NETCore.App/{version}/ildasm ildasm
./ildasm {path}/project.dll >> {path}/project.il
同样的步骤也适用于伊尔卡姆。
使用 dotnet-ildasm tool
# install .net core runtime if required
# sudo apt-get update; \
# sudo apt-get install -y apt-transport-https && \
# sudo apt-get update && \
# sudo apt-get install -y dotnet-runtime-3.0
# find required tool
dotnet tool search ildasm
# output:
# Package ID Latest Version Authors Downloads Verified
# ---------------------------------------------------------------------------
# dotnet-ildasm 0.12.2 pjbgf 100154
# dotasm 1.0.1 DotAsm 434
# install tool
dotnet tool install -g dotnet-ildasm
输出IL到文件:
# go to project folder
cd ../project/bin/Debug/netx.x
dotnet ildasm program.dll -o program.il
https://stackoverflow.com/questions/59595350
复制相似问题