Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5935999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:20:09+00:00 2026-05-22T15:20:09+00:00

In full .NET it is pretty easy to swap out the serializer – either

  • 0

In “full” .NET it is pretty easy to swap out the serializer – either in configuration, or via custom attributes. However, I want to do something similar in Silverlight’s WCF – i.e. provide a different serialization engine. I will provide the engine (protobuf-net) – I just need to get WCF to use it!

Last time I looked at this (some time ago) no good options were obvious. My best kludge was to expose the data as byte[] or Stream – but this loses all the “mex” goodness. Which is a shame, as it all pretty-much just works in full .NET.

Is this yet possible? Bonus points for WP7 too 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T15:20:10+00:00Added an answer on May 22, 2026 at 3:20 pm

    It is possible, but it’s quite hard to do. The class DataContractSerializerOperationBehavior (where you’d usually replace the serializer by overriding the CreateSerializer method) is internal in SL, so you can’t really use it. What you’d need to do is to create an IOperationBehavior which did what the DCSOB does – namely, set the IClientMessageFormatter which the client will use to convert between the Message body (XML Infoset) and the operation parameters / return values. That would mean writing the code to wrap / unwrap the parameters from the operation into / from the Message object. Not completely impossible, but it should work.

    As far as WP7, it doesn’t have the extensibility points required for this solution (IOperationBehavior, IClientMessageFormatter) aren’t there (they were added on SL4, and WP7 is roughly compatible with SL3), so I don’t think it’s possible there – or at least not in a generic way (you can have all your operations declared with Message objects – Message MyOperation(Message input) – and at that stage you can deal with the message Infoset (GetReaderAtBodyContents) directly, but that would need to be done in every operation call.

    Updated: well, I tried and it is possible to do it in Windows Phone 7 (and Silverlight 3) as well, it’s just a lot harder. I recreated the extensibility points using a pair of custom channels. The description of how this can be done can be found at http://blogs.msdn.com/b/carlosfigueira/archive/2011/06/21/wcf-extensibility-extensibility-in-windows-phone-and-silverlight-3.aspx.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want sell some .NET library and I want provide edition with full source
I have the following code in a full .NET framework solution: public delegate int
I need a .NET regular expression that matches anything other than the exact full
Visual Studio 2008 (vb.net) I made simple anivirus but when I make Full scan
I'm renovating an existing ASP.Net web-app which has a full-fledge functional SQL 2005 DB
I am getting the common ASP.NET YSOD error. Here is the full error page
I'm looking for a third-party Oracle Data Provider for .Net (ADO.NET) with a full
I have the following fiddle for people to see http://jsfiddle.net/defaye/DhaHP/4/ The result on full
In the Full .NET framework you can use the Color.FromArgb() method to create a
I'm about to embark on the ASP.net project which involves building a pretty powerful

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.