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

Feb 1, 2012 at 11:17 PM
Edited Feb 1, 2012 at 11:18 PM

Hello,

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?

Developer
Feb 1, 2012 at 11:22 PM
Hi Tuizi,

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

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.

Developer
Feb 1, 2012 at 11:34 PM
Cool. I'm glad you got it working.

happy coding!