-
-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WCF client proxy compile error #27
Comments
Seems like you need to ensure your client proxy uses Serialize.Linq classes, not their auto-generated proxies like ExpressionNodeOfNewExpressionQsd8_SODT. Personally I'm trying to aviod using auto-generated stuff for WCF when possible. That was just an educated guess. Either way I need to look at the code to suggest something. |
Hi @robert-gazsi , thanks for your post. This looks similar to the issue that was discussed in #23 . To be honest, i never used the auto-generator. But let me have a look if the auto-generation can be improved somehow. |
You have a good point by not using the VS auto-generated proxy and in fact I just did that after I posted the issue. Even though I had reused this assembly reference on the client as well, some part of it was still being auto-generated in the proxy data contract. |
hi guys, thanks in advance and sorry for my bad english. |
Hi! Great library and good idea to replace linq expressions to something what could be serialized. namespace {ProjectName}.{ServiceReferenceName}
} |
This issue comes from a presence of generic types in the expression nodes hierarchy. Seems like VS code generator cannot reuse them properly while importing service reference. There is also a related bug: every type with non-standard DataContract name cannot be reused by default. Which is particularly noticeable with SERIALIZE_LINQ_OPTIMIZE_SIZE option. So, in conclusion: Do not use auto-generated clients to work with Serialize.Linq. Data contracts will be all messed up. Provide a manual WCF client implementation for the service. There is nothing esskar can fix here without rebuilding all the data contract hierarchy to get rid of the generics and custom data contract names. |
I also added a working WCF host/client example |
I see, it appears that only generic types cannot be reused. Other types with custom data contract names are reused just fine. There are still trash definitions (see Reference.cs in the WcfClientWithServiceReference app) like public partial class tE : Serialize.Linq.Nodes.ExpressionNode, ...
// tE stands for ExpressionNode`1 But they are not causing problems any more. The only potential issue I see is that client can break service request deserialization logic by sending him an instance of tE instead of a normal ExpressionNode. |
Thanks for the great work!
There is a problem when I try to use the library on a WCF client.
I have added a reference to the library in both the WCF server and client, but still, I get 14 compile errors on the generated WCF client proxy class in Reference.cs, all similar to this: ...ExpressionNodeOfNewExpressionQsd8_SODT does not implement inherited abstract member 'Serialize.Linq.Nodes.ExpressionNode.ToExpression(Serialize.Linq.ExpressionContext)'
If I comment out all these auto-generated classes with errors from Reference.cs file, it works well.
I am using C# 4.5 and the latest library version from nuget - 1.1.4 from 5/10/2013.
The text was updated successfully, but these errors were encountered: