Gets a value that indicates whether assemblies that are loaded into the current application domain execute with full trust.
Assembly: mscorlib (in mscorlib.dll)
This method always returns true for the default application domain of an application that runs on the desktop. It returns false for a sandboxed application domain that was created by using the AppDomain.CreateDomain(String, Evidence, AppDomainSetup, PermissionSet, StrongName) method overload, unless the permissions that are granted to the application domain are equivalent to full trust.
The following example demonstrates the Assembly.IsFullyTrusted property with fully trusted and partially trusted application domains. The fully trusted application domain is the default application domain for the application. The partially trusted application domain is created by using the AppDomain.CreateDomain(String, Evidence, AppDomainSetup, PermissionSet, StrongName) method overload.property and the
The example uses a Worker class that derives from MarshalByRefObject, so it can be marshaled across application domain boundaries. The example creates a Worker object in the default application domain. It then calls the TestIsFullyTrusted method to display the property value for the application domain and for two assemblies that are loaded into the application domain: mscorlib, which is part of the .NET Framework, and the example assembly. The application domain is fully trusted, so both assemblies are fully trusted.
The example creates another Worker object in a sandboxed application domain and again calls the TestIsFullyTrusted method. Mscorlib is always trusted, even in a partially trusted application domain, but the example assembly is partially trusted.
Available since 4.0
Available since 5.0