.NetStandard: Methods and Properties of Missing Types

I have a PCL code that I want to port to .NetStandard. Unfortunately, my code depends on .Net reflection, and I cannot find some of the previously available methods. So, here is a list of methods or properties that I cannot find in .NetStandard. Can someone point me in the right direction how to refactor my code?

Type.IsInstanceOfType() Type.IsAssignableFrom() Type.GetNestedTypes() Type.GetConstructors() Type.IsClass Type.IsEnum Type.IsValueType 
+5
source share
2 answers

Use GetTypeInfo . These members are then accessible outside TypeInfo.

 var example = typeof(string).GetTypeInfo().IsClass; 
+11
source

Or you can use ReflectionBridge : https://www.nuget.org/packages/ReflectionBridge/

+1
source

Source: https://habr.com/ru/post/1257747/


All Articles