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
Solved

WCF Service Reference not picking up custom partial class

Posted on 2011-02-18
2
875 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 40

Author Closing Comment

by:Kyle Abrahams
ID: 34997013
Thanks
0

Featured Post

The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

Question has a verified solution.

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

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

838 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