Reputation: 495
I have a few classes with methods defined in a NuGet package. Some of these methods have "out parameters" and it seems that when I try to call these methods with out keyword an exception of type System.ServiceModel.CommunicationException
is thrown.
Does anyone know why this exception is being thrown?
Are out parameters not allowed when calling Nuget packages?
I tried to bind each parameter manually using colons but I still see the same issue.
System.ServiceModel.CommunicationException: There was an error while trying to serialize parameter http://tempuri.org/:personalCode. The InnerException message was 'Type 'Personal' with data contract name 'Personal:http://schemas.datacontract.org/2004/07/DataContracts' is not expected. Add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.'. Please see InnerException for more details. ---> System.Runtime.Serialization.SerializationException: Type 'PersonalCode' with data contract name 'PersonalCode:http://schemas.datacontract.org/2004/07/DataContracts' is not expected. Add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.
Upvotes: 0
Views: 154