title: C# - How to check if namespace, class or method exists in C#?
body: <p>I have a C# program, how can I check at runtime if a namespace, class, or method exists? Also, how to instantiate a class by using it's name in the form of string?</p>
  
  <p>Pseudocode:</p>
  
  <pre><code>string @namespace = "MyNameSpace";
  string @class = "MyClass";
  string method= "MyMEthod";
  
  var y = IsNamespaceExists(namespace);
  var x = IsClassExists(@class)? new @class : null; //Check if exists, instantiate if so.
  var z = x.IsMethodExists(method);
  </code></pre>