Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WCF and WF
  4. Serailizing CodeDom generated class using WCF

Serailizing CodeDom generated class using WCF

Scheduled Pinned Locked Moved WCF and WF
helpcsharpwcfdesignsysadmin
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Pankaj Chamria
    wrote on last edited by
    #1

    Hi, I am trying to send an object of a dynamically generated class to the client using WCF Service with TCP/IP as protocol. I am generating this class dynamically using CodeDom. First problem: When generating the class dynamically i am not able to mark the class as [DataContract]. It says that DataContract is not found in namespace System.Runtime.Serializable. The same is the case with adding [DataMember] attribute on properties. I have tried adding other attributes like [System.Seriazable()] and that works fine. Second problem: This dynamic type inherits from a base class named "DOPositionBase". While sending i assign the dynamic type "Position" to an object of its parent type "DOPositionBase". But upon trying to send it to the client an error occurs at the server saying "The type "Position" was not expected. Try adding known types that were not statically defined." I cannot define the KnownTypes as the type at design time is unknown. How to proceed then. Please let me know if anyone has ideas about these 2 problems.

    Pankaj Chamria, Software Programmer.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups