Skip to content

lostmsu/TaskRemoting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TaskRemoting

Package can be installed from NuGet: https://www.nuget.org/packages/TaskRemoting/ (TaskRemoting)

Usage sample

using TaskRemoting;

await remoteDomain.Invoke(myObj.MyMethod, myArg);

Partial trust

RemoteTask.Invoke by itself demands unrestricted ReflectionPermission

If you want to call a method in a partial trust domain (sandbox), TaskRemoting must be fully trusted in that domain.

public static StrongName GetStrongName(Assembly assembly)
{
    var assemblyInfo = assembly.GetName();
    var publicKey = new StrongNamePublicKeyBlob(assemblyInfo.GetPublicKey());
    return new StrongName(publicKey, assemblyInfo.Name, assemblyInfo.Version);
}

var taskRemotingStrongName = GetStrongName(typeof(RemoteTask).Assembly);
AppDomain.CreateDomain("Sandbox", null, domainSetup, permissions, fullTrustAssemblies: taskRemotingStrongName);

About

Wraps cross-domain asynchronous method calls, returing System.Threading.Tasks.Task.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages