Detect if the type of an object is a type defined by .NET Framework

前端 未结 4 1124
我寻月下人不归
我寻月下人不归 2020-12-29 10:38

How can I determine by reflection if the type of an object is defined by a class in my own assembly or by the .NET Framework?

I dont want to supply the name of my ow

4条回答
  •  旧时难觅i
    2020-12-29 11:01

    obj.GetType().Assembly == System.Reflection.Assembly.GetExecutingAssembly()
    

    Checks if the type is declared in the current assembly.

提交回复
热议问题