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 1066131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T19:58:17+00:00 2026-05-16T19:58:17+00:00

I am using protobuf-net on the project I am working on for the data

  • 0

I am using protobuf-net on the project I am working on for the data contracts, creating the .proto files by hand and having the custom tool spew forth the C# code which it is duly doing.
I have also started using it for service contracts and the service interfaces are also created just fine.

For connectivity to some systems I am using WCF so I have enabled the datacontracts generator option and, although the the System.ServiceModel attributes are present, there does not appear to be any way for me to declare the specific faults the service may raise.

So my problem is basically:

  • Protocol Buffers language does not appear to have any constructs for exceptions/faults.
  • I cannot see any protobuf-net options for generating FaultContract attributes.
  • The interface generated by protobuf-net is not declared partial so I cannot augment the generated code.

Is there any way to declare service WCF operation faults in protobuf-net or is this something that I would have to wait for version 2 for?

Many thanks.

  • 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-16T19:58:18+00:00Added an answer on May 16, 2026 at 7:58 pm

    I’m not sure why I don’t declare that as partial interface, since that seems perfectly happy in C# 2.0; I’ll get that changed when I get a second, but note that you can apply a manual change locally – simply by editing the csharp.xslt file. Now, xslt isn’t everyone’s cup of tea, but it should be a 1-line change (near to the word interface) – in fact, it is probably the addition of partial here:

    <xsl:template match="ServiceDescriptorProto">
        <xsl:if test="($optionClientProxy or $optionDataContract)">
        [global::System.ServiceModel.ServiceContract(Name = @"<xsl:value-of select="name"/>")]</xsl:if>
        public /* HERE => */ partial /* <= HERE */ interface I<xsl:value-of select="name"/>
        {
          <xsl:apply-templates select="method"/>
        }
    
        <xsl:if test="$optionProtoRpc">
        public class <xsl:value-of select="name"/>Client : global::ProtoBuf.ServiceModel.RpcClient
        {
          public <xsl:value-of select="name"/>Client() : base(typeof(I<xsl:value-of select="name"/>)) { }
          <xsl:apply-templates select="method/MethodDescriptorProto" mode="protoRpc"/>
        }
        </xsl:if>
        <xsl:apply-templates select="." mode="clientProxy"/>
    
    </xsl:template>
    

    Since the the xslt is tweakable, you should be able to apply any other changes you require.

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

Sidebar

Related Questions

I'm trying to use protobuf in a C# project, using protobuf-net, and am wondering
I'm encountering this Exception in my project using Protobuf.net: InvalidOperationException Unexpected sub-type: foo I
Using Protobuf-Net, I see that it does not seem possible to deserialize a class
Using Protobuf/Protobuf-net and two classes, one base class and the other derived from the
I'm using protobuf-net r278 in C#, and I just noticed that if I have
I'm using Protobuf-net. Suppose I have a list of Gizmo objects serialized and that
I have serialized a collection to a file using protobuf-net. I am looking for
I am using protobuf-net r282 and when I call Serialize I get the InvalidOperationException
I'm unable to serialize my class using protobuf-net, the issue seems to be that
Using ASP.NET MVC there are situations (such as form submission) that may require a

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.