C# class type - How to determine whether it is a standard .net framework class

Posted by HorstWalter on Stack Overflow See other posts from Stack Overflow or by HorstWalter
Published on 2010-05-06T01:42:03Z Indexed on 2010/05/06 1:48 UTC
Read the original article Hit count: 218

Filed under:
|
|

C# / .net framework

What is the most reliable way to determine whether a class (type) is a class provided by the .net framework and not any of my classes or 3rd party library classes.

I have tested some approaches

  • The namespace, e.g. starting with "System."
  • The Codebase of the assembly, where the dll is located

All this "feels" a little clumsy though it works.

Question: What is the easiest and most reliable way to determine this?

© Stack Overflow or respective owner

Related posts about c#

Related posts about gettype