Solved

WCF Service Reference not picking up custom partial class

Posted on 2011-02-18
2
881 Views
Last Modified: 2012-06-21
Hi All,

I'm using Linq to SQL to generate the data model for my database.  I need a temporary string property that is generated based on a number of conditions and doesn't need to be stored in the database.  

So on the web portion of my code I've created the following:

Partial Public Class MyClass

    Dim _extendedProperty As String

    Public Property extendedProperty As String

        Get
            Return _extendedProperty
        End Get

        Set(ByVal value As String)
            _extendedProperty = value
        End Set

    End Property

End Class


On the server side of the web service I can see this field no problem.  I get the table from the domain context:

   Dim c As New ClassDataContext(ConfigurationManager.ConnectionStrings("Conn").ToString())

        Dim l As New List(Of MyClass)

Dim pt As MyClass
        For Each p In c.Table
            pt = New MyClass
           'copy members from database.
           pt.ID = p.ID
           pt.Name = p.Name
          'etc

            'extended property from ExtendedDBML.vb
            pt.extendedproperty = ""
            l.Add(pt)
        Next

       return l

However on my client side when I invoke this I'm getting an error that pt.extendedproperty doesn't exist.  I have found that the reference file doesn't contain any information about the property, and the REALLY frustrating part was that I had this working.  

I have tried deleting and re-adding the service, full recompiles, etc.  Nothing seems to be working and need some more ideas.  

Any help greatly appreciated.
0
Comment
Question by:Kyle Abrahams
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 36

Accepted Solution

by:
Miguel Oz earned 500 total points
ID: 34929918
Your extension class must be added to the same name space as the class you are extending.
On cmd prompt do an iisreset to clear up any cache, before adding your web service to your client code
0
 
LVL 40

Author Closing Comment

by:Kyle Abrahams
ID: 34997013
Thanks
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question