views:

73

answers:

2

Source code: http://code.google.com/p/sevenupdate/source/browse/#hg/Source/SevenUpdate.Base

SevenUpdate.Base.Sui cannot be used since it does not match imported DataContract. Need to exclude this type from referenced types.

Now I tried unchecking reuse reference types and I was able to get my project to compile. but when sending a collection from the client it was never received or couldn't be deserialized on the server end.

I really need this to work. Any help would be appreciated, the fullsource code is provided by google code.

A: 

I didnt download the source and build it, but could it be that you are missing DataContract on this class? Sui class has a property of type Sua as DataMember so it will need to be serialized as well. It looks like this in your code currently

[ProtoContract, ]
[KnownType(typeof(ObservableCollection<LocaleString>))]
public class Sua
Fadrian Sudaman
That missing datacontract was a simple error left when I did a search/replace to remove xml attributes, it was there prior. I fixed it and updated the service, error remains the same.
sevenalive
A: 

What would I need to do to reproduce this error? The first bit (about matching data-contract) sounds like WCF isn't very happy with you, which suggests you have two similar (but different) contracts "in play". If you are re-using the types from a shared library this shouldn't be a problem.

If you do end up excluding the types (and having a different model at the client and server) then it can get a bit tricker, since "mex" doesn't guarantee the positions will remain intact (and indde, they regularly change) - but you can fix this in a partial class, by using a few [ProtoPartialMember(...)] against the type (not pretty but it works).

But I stress - the main problem here seems to be WCF; if that isn't happy such that the code doesn't codegen / compile etc, then my hands are fairly tied (since it won't get as far as talking to protobuf-net).

Marc Gravell
The only thing would be to download the source, compile the base and admin projects, run the admin exe, I put it in a loop so it's easier to update the service while testing (it wont do anything except run in a loop on your machine). Then update the service for SevenUpdate, you will see the warning messages.[code]void AddApp(Sua app);void SetUpdates(Collection<Sui> appUpdates);..etc[/code]I started to get the errors. The classes are in SevenUpdate.Base which is shared. Could it be protobuf's attributes are being dropped by WCF causing the mismatch?
sevenalive
It was working fine, I am trying to send the classes to the service and the service returns results. (Duplex Contract), it may be that I just implemented it wrong. Prior to this, I was just serializing a temp file, and having the service deserialize it, something I want to avoid by using the WCF service I already have in place.
sevenalive