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 6562753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:44:48+00:00 2026-05-25T13:44:48+00:00

I have a windows service that references an assembly which contains the following class.

  • 0

I have a windows service that references an assembly which contains the following class.

 [Serializable]
 public class User
    {
        public User(string userName)
        {
            UserName = userName;
        }

        public string UserName { get; private set; }
    }

This service has a method to allow us to create a User:

public User CreateUser(User user)
        {
        //Create and return user
    }

Through remoting we are able to call this method in the service that takes in User object from our application. The application references the same assembly that the service does for the User class but it forces a specific 1.0.0.0 version.

CreateUser(User user);

We would like to change the existing assembly that is referenced from each project to add a new property “Phone” to the User class.

 [Serializable]
 public class User
    {
        public User(string userName)
        {
            UserName = userName;
        }

        public string UserName { get; private set; }
        **public string Phone { get; set; }**
    }

We will increment the assembly version from 1.0.0.0 to 2.0.0.0. The windows service will have a reference to the 2.0.0.0 version of the assembly in the GAC. Because some of our clients are slow at upgrading and they force specific versions of the assembly or copy it local they will still be referencing the 1.0.0.0 version.

With this change to the service assembly reference the marshaller that deserializes/serializes the object from the service to the application throws a serialization error. “The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter…”

The change we made should be a non breaking change since we just added additional feature. Is there a way to allow the existing application continue and use the 1.0.0.0 version of the assembly and serialize the 2.0.0.0 without the new property down to them without some convoluted conversion on the service?

UPDATE:

We are using the following to connect over to our service

marshaller = ChannelFactory<T>.CreateChannel(new NetTcpBinding() { MaxReceivedMessageSize = MaxResponseSize }, new EndpointAddress(new Uri(new Uri(servers[serverIndex]), serviceName)));

Inner exception:
http://tempuri.org/:CreateUserResult. The InnerException message was ”EndElement’ ‘CreateUserResult’ from namespace ‘http://tempuri.org/&#8217; is not expected. Expecting element ‘_someOtherField’.’. Please see InnerException for more details
…Next inner is null

  • 1 1 Answer
  • 0 Views
  • 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-25T13:44:49+00:00Added an answer on May 25, 2026 at 1:44 pm

    As I suspected, here’s the problem;

    NetTcpBinding
    

    (from your edit). Basically, WCF includes some nice friendly contract-based support, and some less-than-friendly type-based support.

    If at all possible, I would suggest the simplest option here is to not use NetTcp as it by default uses NetDataContractSerializer (type-based), so will have versioning issues. Alternatively, you can use oter serializers on the transport – for example DataContractSerializer of protobuf-net. However, changing this would itself be a breaking change.

    I gather it is possible to use a custom binder with NetDataContractSerializer – see Problem deserializing with NetDataContractSerializer after refactoring code . If you can get that working it should preserve the API, but it should not be underestimated; I think that will be a maintenance burden, in all honesty. I’d rather cut my losses, break the API once and switch to a contract-based serializer.

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

Sidebar

Related Questions

I have a Windows service that runs as a logged-in user (local admin). During
I have the following situation: I have a windows service that loads many external
I have a Visual Studio 2010 Solution that contains three projects: A Windows Service
I have a Windows service that writes messages to the Event Log. I also
I have a windows service that does some intensive work every one minute (actually
I have a Windows Service that takes the name of a bunch of files
I have a windows service that generates logs as it does some execution. I
I have a windows service that receives a large amount of data that needs
I have a windows service that loads multiple handlers written by different developers. The
I have a windows service that has it's name set by an app.config. I

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.