System.Reflection.IntrospectionExtensions for .NET

2019-09-18 23:56发布

问题:

Is it possible to get IntrospectionExtensions for .NET 4.0. It is available by default in .NET 4.5, but for various reasons, I would like to use it in .NET 4.0.

回答1:

Simply add the Mono source code to your project and compile it, https://github.com/mono/mono/blob/mono-4.0.2.4/mcs/class/corlib/System.Reflection/IntrospectionExtensions.cs#L40

Make sure you remove it once migrating to .NET 4.5 and above.



标签: c# .net-4.0