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

The Archive Base Latest Questions

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

I have a .NET type, which is attributed with neither ProtoContract nor DataContract. In

  • 0

I have a .NET type, which is attributed with neither ProtoContract nor DataContract. In addition, not all of its state need to be proto-serialized.
Can I define a .proto file for it, but at the same time use some kind of a Serializer to serialize it as though it is attributed with ProtoContract?

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-22T15:14:50+00:00Added an answer on May 22, 2026 at 3:14 pm

    As a third option, [XmlType] and [XmlElement(Order=n)] can be used… but I don’t think that is what you mean ;p

    In “v2”, this is indeed possible. You don’t need to define a .proto – you can simply tell it what to do at runtime, for example:

    var model = TypeModel.Create();
    model.Add(typeof(SomeType)).Add("Foo", "Bar", "Blip");
    

    now store model somewhere (and re-use it), and use model.Serialize(...) and model.Deserialize(...). The above configures SomeType to serialize .Foo (as field 1), .Bar (as field 2) and .Blip (as field 3). There are of course many more ways of doing this for more fine-grained control.

    It will generate (as first needed) a serializer (via IL emit, so very fast) that works with your types as expected.

    There is a downloadable “v2” dll, but it needs updating – I have done a lot of fixes in the last few weeks. I will try to refresh this dll later today, or you can build from code.

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

Sidebar

Related Questions

Does .NET have some type of built in function that allows filtering on Gridviews?
What is the most appropriate .Net exception type for when you have a class
I have an ASP.NET Webform and inside the form I have an input type
I am programming in .NET I have an application setting of type string. On
In .NET, a value type (C# struct ) can't have a constructor with no
When using ASP.net webforms my usual solution would have following type of setup -
I am currently working with .Net 2.0 and have an interface whose generic type
Work on asp.net vs05. I have three type of value Like:IsDesign,IsPrinting,IsInstall they are bit
I have a custom type that I created, which should be persisted in a
I have an ASP.NET / C# application in which the Master Page contain the

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.