项目作者: aelij

项目描述 :
Utilizes System.Reflection.Metadata to read type information very fast and without locking assembly files.
高级语言: C#
项目地址: git://github.com/aelij/FasterReflection.git
创建时间: 2016-06-10T11:40:37Z
项目社区:https://github.com/aelij/FasterReflection

开源协议:MIT License

下载


FasterReflection

Utilizes System.Reflection.Metadata to read type information very fast and without locking assembly files.

NuGet

  1. Install-Package FasterReflection

Example

  1. // type defined in MyAssembly.dll
  2. public class MyType { }
  3. var builder = new ReflectionMetadataBuilder();
  4. builder.AddAssembly("MyAssembly.dll");
  5. builder.AddReferenceOnlyAssemblyByType<object>(); // adds the corlib
  6. var result = builder.Build();
  7. var myType = result.FindTypesByName("MyType").First();
  8. Console.WriteLine(myType.BaseType.FullName); // 'System.Object'
  9. Console.WriteLine(myType.IsPublic); // 'True'
  10. Console.WriteLine(myType.HasNonDefaultConstructors); // 'False'
  11. Console.WriteLine(myType.GenericArgumentCount); // '0'