Multiple known types ArrayOfstring on IService methods

65 views Asked by At

Late converting our fabric services from V1 to V2 and running into problems with known types. Using 3.4.677 of Remoting.

Getting the following error:

```Type 'System.Collections.Generic.List`1[System.String]' cannot be added to list of known types since another type 'System.String[]' with the same data contract name 'http://schemas.microsoft.com/2003/10/Serialization/Arrays:ArrayOfstring' is already present.```

No of the objects (i.e. contracts) returned by service methods (i.e. IService) use anything other than string[] as a collection of string. The problem arises in the IService method definitions in particular on parameter (note: not return types). Changing all List<string> to string[] in a method parameters solves the problem. However, I would like to not alter the IService interface.

The error states that an additional "known type" of ArrayOfstring can not be added. The addition of ServiceKnownType(typeof(List)) attribute on methods with List<string> has no effect.

Is there any other attribute that can be applied to effect the produced xml definition to allow additional ArrayOfstring types?

0

There are 0 answers