question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make base entity classes use MarshalByRefObject

See original GitHub issue

MarshalByRefObjects as you may know are for cross-AppDomain communication. If you’re going for “modern and secure” practices, implementing it would be a good idea. There are no downsides to this known to me.

AppDomains could be used to safely load DLL modules in a restricted sandboxed environment, and by using MarshalByRef enabled objects any entity can easily be accessed between AppDomains.

Code changes are easy and unnoticeable. In case of SocketEntity.cs for example, it’s a matter of changing
SocketEntity<T> : IEntity<T>
to
SocketEntity<T> : MarshalByRefObject, IEntity<T>

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
khionucommented, Mar 14, 2017

.NET Standard doesn’t cover AppDomains, and since Discord.Net 1.0 targets .NET Standard 1.1 and 1.3, it can’t implement AppDomain APIs. This is a frustrating issue for many that relied upon AppDomains, as you can imagine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to solve "Must be MarshalByRefObject" in a good but ...
It depends on how you need to get at it. Using a base class that derives from MarshalByRefObject might do it. Aggregation might...
Read more >
MarshalByRefObject Class (System)
MarshalByRefObject is the base class for objects that communicate across application domain boundaries by exchanging messages using a proxy. Objects that do not ......
Read more >
MarshalByRefObject - C# in a Nutshell [Book]
MarshalByRefObject is the base class for objects that are marshaled by reference across AppDomain boundaries. If you attempt to transmit an object that ......
Read more >
Type: System.MarshalByRefObject
MarshalByRefObject is the base class for objects that communicate across application domain boundaries by exchanging messages using a proxy.
Read more >
Entity Base Class
Every domain class not only has the Id property, but itself is an entity. It is important to remove possible misunderstandings; using an ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found