In my reflection code i hit a problem with my generic section of code. Specifically when i use a string.
var oVal = (object)\"Test\";
var oType = oVal.GetType();
It looks like you're trying to call a constructor which just takes a string - and there isn't such a constructor. If you've already got a string, why are you trying to create a new one? (When you didn't provide any further arguments, you were trying to call a parameterless constructor - which again, doesn't exist.)
Note that typeof(string)
is a simpler way to get a reference to the string type.
Could you give us more information about the bigger picture of what you're trying to do?