Closed bafrin closed 6 years ago
@bafrin Can you share the WSDL file that reproduce the problem?
Hi @Lxiamail,
Thanks for your comment, I am still struggling with this issue;
Expression:
(new System.Collections.Generic.Mscorlib_CollectionDebugView
The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter ... The InnerException message was 'The use of type 'System.Data.Linq.Binary' as a get-only collection is not supported with NetDataContractSerializer. Consider marking the type with the CollectionDataContractAttribute attribute or the SerializableAttribute attribute or adding a setter to the property.'. Please see InnerException for more details. ---InnerException---- The use of type 'System.Data.Linq.Binary' as a get-only collection is not supported with NetDataContractSerializer. Consider marking the type with the CollectionDataContractAttribute attribute or the SerializableAttribute attribute or adding a setter to the property.
Unfortunately I cannot share the original wsdl for you and I haven't been able to replicate the error in a new project!! I will share the wsdl as soon as it is ready!
@bafrin any updates on this issue?
@bafrin NetDataContractSerializer is not supported on WCF Core. Are you doing this on .NET Framework?
@bafrin Haven't heard back from you for sometime. Closing this issue for now.
System.Data.Linq is not part of .NET Core 2.0 and therefore the following class is created in the data contract while importing service reference wsdl
As you see, it has a setter. But at run time it ends in the following exception
"The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter ... The InnerException message was 'The use of type 'System.Data.Linq.Binary' as a get-only collection is not supported with NetDataContractSerializer. Consider marking the type with the CollectionDataContractAttribute attribute or the SerializableAttribute attribute or adding a setter to the property.'. Please see InnerException for more details."
" at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)\r\n at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)\r\n at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)\r\n at System.ServiceModel.Channels.ServiceChannelProxy.TaskCreator.<>c__DisplayClass1_0.b__0(IAsyncResult asyncResult)\r\n--- End of stack trace from
The same wsdl does not create a binary class in .net framework and simply uses System.Data.Linq.Binary
I have already tried IgnoreDataMemberAttribute SerializableAttribute CollectionDataContractAttribute
but non of them help. I even tried a .net framework class library making the service call to wcf as a reference in .net core2 project but resulted in the framework version is not supported
Any help would be appreciated