views:

25

answers:

1

I don't want my WPF application to run in Fulltrust but it's impossible to run WPF in a partial trust AppDomain (i tried even with WPF hosting/interop) and WPF Browser Application does not fit my needs, so my question is:

is there a way to change the SecurityZone of the current AppDomain at runtime after WPF has created the Window and made all the initialization unmanaged calls?

Thank you :)

+2  A: 

It is impossible, as once you have run in FullTrust you are 'tainted', and it is impossible for the runtime to guarantee Partial Trust. However, depending on your scenario, you can create another AppDomain to run untrusted code in, and marshal objects to and from the full/partial domain, or you can write your app as a SL4 Out-of-Browser app which has stricter restrictions.

Paul Betts