Solved

WCF Service Reference not picking up custom partial class

Posted on 2011-02-18
2
869 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
2 Comments
 
LVL 35

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 39

Author Closing Comment

by:Kyle Abrahams
ID: 34997013
Thanks
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

759 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now