I need to load an untrusted assembly into my AppDomain. I don't want to Sandbox a new AppDomain for this assembly to execute in, because it internally requires access to certain functionality such as HttpContext.Current (which would be null in a separate sandboxed AppDomain).
I think the old way of doing this would have been calling Assembly.Load with some custom Evidence, but it looks like this has been made obsolete by the CAS changes in 4.0:
http://msdn.microsoft.com/en-us/library/ms145229.aspx
http://msdn.microsoft.com/en-us/library/ee191568(VS.100).aspx
I don't quite understand how I can accomplish what I want here with the new security model... Could someone please explain or suggest an alternative approach?
Thanks.
The article is an immense mouthful...
http://msdn.microsoft.com/en-us/library/dd984947.aspx
But I finally found what I was looking for:
http://msdn.microsoft.com/en-us/library/system.web.hosting.hostsecuritypolicyresolver.aspx
Just took a long long time to find...
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