title: How can I know if I cannot convert a string into a object using TypeConverter.ConvertFromInvariantString
body: <p>I'm using <code>TypeConverter.ConvertFromInvariantString</code> in order to convert strings into concrete types.</p>
  
  <p>Some conversions fail via and exception, and I would like to know about the failure before trying to convert.</p>
  
  <p>Code example that will fail:</p>
  
  <pre><code>var tc = TypeDescriptor.GetConverter(typeof(int));
  var val = tc.ConvertFromInvariantString("1.5");
  </code></pre>
  
  <p>Code that I'd wan't to have:</p>
  
  <pre><code>var canConvert = CanConvert(tc, "1.5", typeof(int));
  if(canConvert)
  {
     var val = tc.ConvertFromInvariantString("1.5");
     ......
  }
  </code></pre>
  
  <p>I prefer not to use a try\catch block as a solution as I wan't to get a list of properties prior to the operation.</p>
  
  <p>I've noticed the <code>CanConvertFrom</code> method that doesn't really work (It returns false when converting a float to double while the <code>TypeConverter.ConvertFromInvariantString</code> method succeeds).</p>
  
  <p>So, is there a way to determine if I can convert the string into the type prior to the conversion?</p>