What is ContextBoundObject used for? The documentation mentions 'contexts', which seem to be programatically defined, but fails to give any explanation as to what one is.
Asked
Active
Viewed 5,175 times
16
-
It's an atrocity. It's paved with pitfalls. I don't see a reason to use it, but it makes an interesting read: http://www.albahari.com/threading/part2.aspx#_Synchronization_Contexts – HuBeZa Jul 09 '18 at 06:20
2 Answers
9
It's the base class providing facilities for synchronization domains in .NET (a little known feature in since .NET 1.0)

Matt Hinze
- 13,577
- 3
- 35
- 40
4
This explanation sounds completely different than the accepted answer, but it makes more intuitive sense:
So what about
ContextBoundObject
?Firstly, it allows you to do everything you can do with
MarshalByRef
object. Secondly, it allows you to do more. You can take control over the details of control over object creation, proxy creation, and marshalling method calls.