Created attachment 2430 [details]
Please note the file has been highly modified for my application.
Specifying a KnownType attribute on a WCF method that is synchronous will not work. This is due to the BaseMessageFormatter not copying the known types from the OperationDescription. When you try and run the client it will fail as it is not able to serialize the known type. Here is the fix which should be made to the BaseMessagesFormatter in the constructor. Previously if SyncMethod was not null it would return before copying the known types.
public BaseMessagesFormatter (OperationDescription desc)
: this (desc.Messages)
if (desc.SyncMethod != null)
isAsync = false;
requestMethodParams = replyMethodParams = desc.SyncMethod.GetParameters();
isAsync = true;
ParameterInfo methodParams = desc.BeginMethod.GetParameters();
requestMethodParams = new ParameterInfo[methodParams.Length - 2];
Array.Copy(methodParams, requestMethodParams, requestMethodParams.Length);
methodParams = desc.EndMethod.GetParameters();
replyMethodParams = new ParameterInfo[methodParams.Length - 1];
Array.Copy(methodParams, replyMethodParams, replyMethodParams.Length);
//Add the known types for serialization.
What did you do to work around this?
Seems like the fix is provided so why not implement?