Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 679395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:15:18+00:00 2026-05-14T01:15:18+00:00

I have an Entity Framework data model. Part of the model is a Customer

  • 0

I have an Entity Framework data model. Part of the model is a Customer entity. The web service provides a method to get a customer, and to receive an updated version of this customer to be persisted.

To test this, I created a new ASP.NET web Application, (Solution > Add > New Project > ASP.NET Web Application), then added a reference to my service reference using the standard Add Service Reference dialog. I then call the service using the following code:

var client = new CustomerServiceClient();
var customer = client.GetCustomerByID(18); // get it
customer.LimitDown = 100; // change it
client.SaveCustomer(customer); // persist it

Everything works as expected.

Now, I do exactly the same thing, but this time with as ASP.NET Web Site (Solution > Add > New Web Site > ASP.NET Web Site). I add the reference in a similar fashion and copy and paste the code above into the new site. But now I get the following exception thrown on the 4th line:

System.InvalidOperationException The
EntityReference object could not be
serialized. This type of object cannot
be serialized when the
RelationshipManager belongs to an
entity object that does not implement
IEntityWithRelationships.

Source Error:

Line 2474: Line 2475:
public
SkyWalkerCustomerService.OperationResult
SaveCustomer(SkyWalkerCustomerService.Customer
customer) { Line 2476:
return
base.Channel.SaveCustomer(customer);
Line 2477: } Line 2478: }

Stack Trace:

System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
reqMsg, IMessage retMsg) +9475203
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
msgData, Int32 type) +345
SkyWalkerCustomerService.ICustomerService.SaveCustomer(Customer
customer) +0
SkyWalkerCustomerService.CustomerServiceClient.SaveCustomer(Customer
customer) in
c:\Windows\Microsoft.NET\Framework\v4.0.30128\Temporary
ASP.NET
Files\testsite2\dd2bcf8d\f95604ff\App_WebReferences.fz4h7x7l.0.cs:2476
_Default.Page_Load(Object sender, EventArgs e) in
c:\Users\Mike\Documents\Repositories\UWC\SkyWalker\TestSite2\Default.aspx.cs:17
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr
fp, Object o, Object t, EventArgs e)
+14 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object
sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs
e) +91
System.Web.UI.Control.LoadRecursive()
+61 System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean
includeStagesAfterAsyncPoint) +1966

Googling for this error returns very little. Why doesn’t this work?

I guess one answer would be to use a web application instead of a web site, but I have an large existing site to which I need to add the service reference, and I’d rather not convert it.

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T01:15:19+00:00Added an answer on May 14, 2026 at 1:15 am

    Temporary workaround – I changed the .NET Framework version of the web site to 3.5, and now it works correctly. This is fine for my project, but I’d like to know for future reference why the original problem occurred.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem with the following Linq query using Entity Framework: from o
I am using Entity Framework with my website. To improve performance, I have started
Setting up ASP.net MVC with Linq2SQL or Entity Framework's context to have scaffolding work
So, I am using the Linq entity framework. I have 2 entities: Content and
Please if you have used NHibernate and Entity Frameworks, please contrast your experiences.
I have an entity that maps to an external oracle table which is one
I have an entity class that has a property with an underlying db column
Lets say I have an entity Foo, and it contains a list of another
Here's what I'm trying to do : I have an entity Task with a
Using NHibernate.Mapping.Attributes, I have a entity class with something like: [Class] public class EntityA

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.