Results 1 to 7 of 7

Thread: Can't get DataContract in Silverlight 4

  1. #1
    Join Date
    Mar 2010
    Posts
    46

    Can't get DataContract in Silverlight 4

    I need to do DataContract serialization but the problem is that errors are annoying me, and I am not able to find the solution for this problem. The one of the error that I am getting is that the type of namespace name and the “Datacontract” cannot be discovered, and the message that I am getting is that “are you missing an assembly reference.” As far as I know I have done the coding correct. But not getting the result for that. I want to know way I can’t get DataContract in Silverlight 4

  2. #2
    Join Date
    Nov 2009
    Posts
    499

    Re: Can't get DataContract in Silverlight 4

    I am not getting the same error but the related error. I thought that it will be better to discuss here may be solution for is available here. I am getting the error for namespace or the type of 'DataContractAttribute', the problem is that I cannot be found. After that I am getting the same message that is “are you missing assembly reference”. Any related reply will be appreciated.

  3. #3
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Can't get DataContract in Silverlight 4

    Well my friend you are saying that you are facing problem, but you have not given any related code for that. It will be better if you can provide some snippet of code so that I can better understand your problem. As per the description that you have given, I think that you are using WCF service application Template for generating your service. But before giving any suggestion I need your confirmation and the snippet of code that is giving you problem.

  4. #4
    Join Date
    Mar 2010
    Posts
    46

    Re: Can't get DataContract in Silverlight 4

    Here is the code that I am using
    Code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Runtime.Serialization;
    
    [DataContract]
    public class Test
    {
    }
    I can see the DataContract that is in the ClassViewer, but the problem is that even if I am using Intellisnser it is providing only four event. I think I am missing something but have no idea what is to be done for getting this thing right. I will be waiting for your reply

  5. #5
    Join Date
    Nov 2009
    Posts
    499

    Re: Can't get DataContract in Silverlight 4

    I think I have generated a normal graphical user interface through silverlight application. The thing I need is an easy method for serializing and also deserializing a class. I am not confident but I think that DataContracts can be a way for achieving this. If you can provide any related information to that then I will be really thankful. Anyways thanks for the reply.

  6. #6
    Join Date
    Feb 2010
    Posts
    570

    Re: Can't get DataContract in Silverlight 4

    The problem you are facing is really simple to resolve, you just need to add a simple snippet of code in your program and that will definitely solve your problem. You need to add System.Runtime.Serialization to the reference. That’s all you need to do for solving the problem. If you face any other problem then let me know I will try to resolve that issue as soon as possible.

  7. #7
    Join Date
    Feb 2010
    Posts
    129

    Re: Can't get DataContract in Silverlight 4

    The various web services from the same application may need to share the same data structures. By default, when adding these webservices to the solution, Silverlight duplicates generated data classes. Imagine a DataContract User returned by a webservice Users.svc which manages users and used in webservice Rights.svc which manages the rights of the application.

Similar Threads

  1. Silverlight 5 released; will there be a Silverlight 6?
    By GopuHD in forum Windows Software
    Replies: 4
    Last Post: 11-01-2012, 02:28 PM
  2. Replies: 5
    Last Post: 28-04-2011, 10:27 AM
  3. Replies: 3
    Last Post: 17-04-2011, 04:55 PM
  4. Replies: 2
    Last Post: 09-08-2010, 09:41 AM
  5. What is SilverLight?
    By Champak in forum Windows Software
    Replies: 4
    Last Post: 31-01-2009, 10:21 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,052,044.16777 seconds with 16 queries