https://github.com/lostmsu/taskremoting
Wraps cross-domain asynchronous method calls, returing System.Threading.Tasks.Task.
https://github.com/lostmsu/taskremoting
Last synced: over 1 year ago
JSON representation
Wraps cross-domain asynchronous method calls, returing System.Threading.Tasks.Task.
- Host: GitHub
- URL: https://github.com/lostmsu/taskremoting
- Owner: lostmsu
- License: apache-2.0
- Created: 2015-07-27T00:48:44.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-08-09T07:16:22.000Z (almost 11 years ago)
- Last Synced: 2025-04-02T06:09:34.115Z (over 1 year ago)
- Language: C#
- Homepage:
- Size: 191 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TaskRemoting
Package can be installed from NuGet: https://www.nuget.org/packages/TaskRemoting/ (TaskRemoting)
# Usage sample
```csharp
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.
```csharp
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);
```