'string' does not contain a definition for 'CanConvertTo'

Feb 2, 2012 at 12:17 AM
Edited Feb 2, 2012 at 12:18 AM


I'm just adding this library with NuGet.

I see all the extensions in Intelliscence but, when I'm using a method, I can't compile!

For exemple, Im using the method CanConvertTo<> on my string variable, and I get the error:

Error 1 'string' does not contain a definition for 'CanConvertTo' and no extension method 'CanConvertTo' accepting a first argument of type 'string' could be found

What's wrong?

Feb 2, 2012 at 12:22 AM
Hi Tuizi,

Have you got references to System.Web in your project?
Try it and let us know if it work for you.
Feb 2, 2012 at 12:32 AM

My bad, I change the Target framework from ".NET Framework 4 Client Profile" to ".NET Framework 4" and it's ok.

No reference to System.Web is needed.

Feb 2, 2012 at 12:34 AM
Cool. I'm glad you got it working.

happy coding!