在Linux环境中获取dll元数据

问题描述 投票:0回答:1

[我希望能够在Linux环境中(即,在运行任何dll docker映像时,)获得任何mcr.microsoft.com/dotnet/core/sdk(尽可能返回支持dotnet版本的元数据)。

可以实现吗?

通过元数据,我的意思是我无需加载就可以告诉代码的所有信息(最重要的是-名称空间,版本)。

我观察到Assembly.ReflectionOnlyLoadFrom(),但它似乎不支持dotnet-core之前的版本。

我不仅限于编程语言,而不仅限于基于Linux的运行时。

c# .net dll .net-core .net-assembly
1个回答
0
投票

我无法使任何标准工具在Windows之外运行(ilspy,dnspy,ildasm)

但是exiftool中引用的this question,似乎仍然可以很好地用于提供一些元数据,尽管它仍然受到限制。

exiftool Newtonsoft.Json.net45.dll的示例输出:

ExifTool Version Number         : 11.73
File Name                       : Newtonsoft.Json.net45.dll
Directory                       : .
File Size                       : 660 kB
File Modification Date/Time     : 2019:04:22 02:06:26+03:00
File Access Date/Time           : 2019:10:28 10:11:25+02:00
File Inode Change Date/Time     : 2019:10:28 10:09:56+02:00
File Permissions                : rwxr-xr-x
File Type                       : Win32 DLL
File Type Extension             : dll
MIME Type                       : application/octet-stream
Machine Type                    : Intel 386 or later, and compatibles
Time Stamp                      : 2092:04:05 06:43:32+03:00
Image File Characteristics      : Executable, Large address aware, DLL
PE Type                         : PE32
Linker Version                  : 48.0
Code Size                       : 665088
Initialized Data Size           : 2048
Uninitialized Data Size         : 0
Entry Point                     : 0xa42ba
OS Version                      : 4.0
Image Version                   : 0.0
Subsystem Version               : 6.0
Subsystem                       : Windows command line
File Version Number             : 12.0.2.23222
Product Version Number          : 12.0.2.0
File Flags Mask                 : 0x003f
File Flags                      : (none)
File OS                         : Win32
Object File Type                : Dynamic link library
File Subtype                    : 0
Language Code                   : Neutral
Character Set                   : Unicode
Comments                        : Json.NET is a popular high-performance JSON framework for .NET
Company Name                    : Newtonsoft
File Description                : Json.NET
File Version                    : 12.0.2.23222
Internal Name                   : Newtonsoft.Json.dll
Legal Copyright                 : Copyright © James Newton-King 2008
Legal Trademarks                :
Original File Name              : Newtonsoft.Json.dll
Product Name                    : Json.NET
Product Version                 : 12.0.2+4ab34b0461fb595805d092a46a58f35f66c84d6a
Assembly Version                : 12.0.0.0
© www.soinside.com 2019 - 2024. All rights reserved.