繁体   English   中英

无法使用ILSpy / Reflector查看System.Management.ManagementDateTimeConverter.ToDateTime(string)的反编译代码?

[英]Unable to see the decompiled code of System.Management.ManagementDateTimeConverter.ToDateTime(string) using ILSpy/Reflector?

我正在尝试查看System.Management的实际实现细节。 使用ILspy的ManagementDateTimeConverter.ToDateTime (字符串)? 它什么也没显示。 然后我认为这可能是ILSpy中的错误,并尝试使用Reflector查看反编译的代码-但它也没有显示详细信息(请参见下面的代码片段)。

基本上,我试图查看cim datetime的解析方式-有关详细信息,您可以参考:( 此时间值的格式是什么? ,将CIM_DateTime解析为.Net DateTime

问题

  1. 为什么我看不到此特定功能/程序集的反编译代码?

  2. 有关managementdatetimeconverter如何解析CIM DateTime类型的字符串的任何详细信息?


// System.Management.ManagementDateTimeConverter
/// <summary>Converts a given DMTF datetime to <see cref="T:System.DateTime" />. The returned <see cref="T:System.DateTime" /> will be in the current time zone of the system.          </summary>
/// <returns>A <see cref="T:System.DateTime" /> that represents the given DMTF datetime.</returns>
/// <param name="dmtfDate">A string representing the datetime in DMTF format.</param>
public static DateTime ToDateTime(string dmtfDate)
{
}

感谢您的所有快速评论-它帮助我找到了一种查看ToDateTim(..)所寻求实现的方法。

Visual Studio属性窗口将system.management程序集位置显示为“ C:\\ Program Files(x86)\\ Reference Assemblies \\ Microsoft \\ Framework.NETFramework \\ v4.5 **** System.Management.dll ****”。 因此,我已经使用它来反思实现。

一旦看到上面的注释,并确认它在其他程序中也可以使用,我便尝试查看运行时已加载了哪个程序集-“调试+模块”窗口显示该程序集已从“ C:\\ Windows \\ Microsoft.Net \\ assembly \\ GAC_MSIL \\ System.Management \\ v4.0_4.0.0.0__b03f5f7f11d50a3a ** System.Management.dll **”-因此对其进行反思,显示了实际的代码。

最好的祝福!

使用ILSpy,您还可以从GAC加载程序集。

菜单“文件>从GAC打开...”

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM