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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:06:52+00:00 2026-05-14T20:06:52+00:00

I am new to WCF and have a simple question… My DataContract class returns

  • 0

I am new to WCF and have a simple question…

My DataContract class returns an Enum type to the consumer from one of it’s exposed methods.

The consumer is able to see the enum type, and instantiate variables of that typel.

However, I have not provided a [DataContract] nor [EnumMember]s for the enum in the service.

My question is, why is the client still able to see it??
I thought that I would have had to make it a [DataContract] for it to be serialized along with the business object, no?

  • 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-14T20:06:53+00:00Added an answer on May 14, 2026 at 8:06 pm

    Yes – you had to – up to .NET 3.5 SP1.

    Microsoft “loosened” the rules and now the DataContractSerializer will behave like the XmlSerializer, if you don’t put any [DataContract] and [DataMember] attributes on anything: it will just simply serialize all public properties and necessary types.

    While this might be a “simpler” approach for the simple scenario, you also loose lots of control over namespace, ordering etc. – so I prefer to still apply those attributes explicitly, just to clearly express (and document!) my intent. But with .NET 3.5 SP1, it’s no longer required and enforced by the DataContractSerializer.

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

Sidebar

Related Questions

I have simple chat program using WCF service. One service use for server and
Edited 3.9.2011 to add one more related question Hello, I'm very new to WCF
I have simple application from this tutorial: WCF 4 Getting Started Tutorial How can
This is real simple. I have a wcf service (nothing fancy, just New Project->
I am pretty new to WCF in general. What little experience I have comes
I'm new here and I hope anyonte can help me. I have WCF Service
I have WCF service running from within a Windows Service. This is working fine
Put simply, I have a WCF service that manages apples. Apart from other functionality,
My question is similar to this one JsonConvert.DeserializeObject and "d" wrapper in WCF but
In my WCF web service I have been reading from the database with no

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.