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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:05:35+00:00 2026-05-28T00:05:35+00:00

I have a small class what I made thread safe with the [Synchronization] attribute,

  • 0

I have a small class what I made thread safe with the [Synchronization] attribute, it also implements the ContextBoundObject interface. I’d like to make this class [Serializable]. The code compiles but I receive an

System.Runtime.Remoting.RemotingException: Remoting cannot find field '__identity' on type 'System.MarshalByRefObject'

exception. I knew that classes marked with [Synchronization] are accessed through some ‘remote’ proxy but I hoped the default serialization mechanism will work.

This is a small app, the class is just an in-memory sequence (integer id) generator so no real remoting is done. I guess I can synchronize by other means (lock keyword) but I’d like to know what is the standard solution for this problem.

Update: at the end I abandoned the [Synchronization] attribute in order to use the basic serialization.

  • 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-28T00:05:36+00:00Added an answer on May 28, 2026 at 12:05 am

    Instead of just using the Serializable attribute, you can implement the ISerializable interface.

    You can read more about it here: http://msdn.microsoft.com/en-us/library/system.runtime.serialization.iserializable.aspx

    Basically you have to implement one method – GetObjectData – and a constructor with a similar signature.

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

Sidebar

Related Questions

I have a small class hierarchy where I would like to have a child
I have this small class called City that simply holds some information about a
I made this small location class so that I can better handle address information
Let's say I have objects which look very roughly like this: class object {
I have written a Java applet class and made a small HTML page to
I have written this small code snippet in C++, the output is also attached.
I have made a small custom view component: public class ActionBar extends RelativeLayout {
I have small class called 'Call' and I need to store these calls into
I have a small class that displays an alert via Javascript. I am using
I have a not-so-small class under development (that it changes often) and I need

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.