Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

WCF Service Reference not picking up custom partial class

Posted on 2011-02-18
2
Medium Priority
?
885 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 1500 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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.…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

660 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