Solved

WCF Service Reference not picking up custom partial class

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Here I am going to explain creating proxies at runtime for WCF Service. So basically we use to generate proxies using Add Service Reference and then giving the Url of the WCF service then generate proxy files at client side. Ok, what if something ge…
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

617 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