Error Cannot implicitly convert type 'string[]' to 'System.Collections.Generic.List<string>'
The above error is caused when I call a method to a web service
List<string> bob = myService.GetAllList();
Where: GetAllList =
[WebMethod] public List<string> GetAllList() { List<string> list .... return list; }
I have rebuilt the whole solution, updated the service references and still I get a cast exception any ideas?
you need to do this:
An overload for the constructor of a generic list takes an IEnumerable of the specified type to initialize the array. You can not, like the exception states, implicitly cast it staright to that type.
Andrew