Can CancellationTokens be used through AppDomains?

.NET 4 introduced several types to well support shared disconnection . I would like to be able to cancel the operation running in another AppDomain. The CancellationToken type is a structure. If I transfer it to another AppDomain, will it work fine?

+5
source share
1 answer

I am not familiar with .NET 4 or revocation tokens, but the revocation structure does not have the SerializableAttribute attribute, so you probably cannot transfer it through the AppDomain interface.

Perhaps you can create a MarshalByRefObject wrapper to do this for you.

+2
source

All Articles