Say I have the string "System.Xml.XmlException". How can I create an object from that?
object[] args = new object[2];
args[0] = "Message";
args[1] = new Exception("Inner Exception Message");
Exception fooBar = (Exception)Activator.CreateInstance(typeof(System.Xml.XmlException), args);
Console.WriteLine(fooBar.ToString());
This works, but I can't figure out how to get the type from just the string "System.Xml.XmlException".
object[] args = new object[2];
args[0] = "Message";
args[1] = new Exception("Inner Exception Message");
Exception fooBar = (Exception)Activator.CreateInstance(typeof(System.Xml.XmlException), args);
Console.WriteLine(fooBar.ToString());
This works, but I can't figure out how to get the type from just the string "System.Xml.XmlException".