c# - Can I tell the CLR to marshal immutable objects between AppDomains by reference? -


When the objects in the .NET are martial to the objects between the AppDomains, the CLR will serial the object (if it is is serializable

attribute) or it will generate a proxy (if it is derived from martialbirf )

With reference to the strings, the references to the CLR string object are found in the new app docs will do it. CLR still ensures integrity because the NIT string is irreversible and any change for the string by the other app dotmen will not affect the original object.

I have been brought to my question: whether my custom type of CLR is irreversible and when used in remoting it should pass only the reference of the object as with string class it happens?

Marshling is in fact

The behavior you describe is called " Martial by-bleed ", the runtime uses it in martial strings (sometimes) and martial systems. threading. Always read

As far as I can tell that there is no control over it (it is mentioned in this article that you can define custom marshaling behavior, but I can not find any documents on it) , You can potentially pass an intake and use the unsafe code to simulate it, but it smells like a big hack for me


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -