Live Chat Icon For mobile
Live Chat Icon

How do I detect permission for a file in a partial trust application ?

Platform: WPF| Category: Partial Trust Security

This situation occurs when an assembly is used by both windows and XBAP application in a partial trust. The assembly might have permission when used through windows application and the same when used through XBAP application will throw a security exception. To prevent this situation, the permission for a file can be checked using the ‘Demand()’ method on the instance of the desired permission. If a file doesn’t have permission, the Demand() method throws a security exception, else it can be used by the partial trust application.

Share with

Share on twitter
Share on facebook
Share on linkedin

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.