I'm trying to follow http://msdn.microsoft.com/en-us/library/bb763046.aspx to create a sandbox to run untrusted code.
When I execute this in my Sandboxer class:
StrongName fullTrustAssembly = typeof(Sandboxer).Assembly.Evidence.GetHostEvidence<StrongName>();
I will get null returned. Why? How do I fix it?
You must sign your application. The easiest way to do it is:
Run the Run Partially Trusted Code in a Sandbox sample again. It should work.
According to the page you linked, all of the calls to GetHostEvidence<T>() are being supplied with StrongName as the type parameter. If the assembly doesn't have a strong name (not all do), it will return null.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With