且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何知道应用程序的.NET版本

更新时间:2023-10-23 08:58:28

System.Environment.Version将给出当前正在执行的.NET版本。 System.Reflection.Assembly.ImageRuntimeVersion将提供程序集清单中包含的.NET版本,但我认为您不能在各种版本的CLR 2.0之间获得任何粒度。我没有看到.NET反射器或ildasm中的任何元数据区分vs2005和vs2008。
System.Environment.Version will give the version of .NET currently executing.  System.Reflection.Assembly.ImageRuntimeVersion will give the .NET version contained in the assembly's manifest, but I don't think you can get any granularity between the various versions of CLR 2.0.  I don't see any metadata in .NET reflector or ildasm that differentiates vs2005 and vs2008.