Last post Nov 06, 2007 09:13 PM by Nai-Dong Jin - MSFT
Nov 05, 2007 02:25 PM|DC Ross|LINK
I have a control (dll) that needs full trust granted to it (which we do with caspol).
From a web form, I'd like to be able to determine if the control already has full trust permissions. I've searched and searched, but haven't found anything useful.
Nov 06, 2007 09:13 PM|Nai-Dong Jin - MSFT|LINK
I’m not sure if I’ve misunderstood your words. Actually the dll is an assembly, you mentioned that if the control has full trusted permission, do you mean the permission of the assembly? Otherwise, what kind of permission of a custom control by your words?
So based on my understanding, it’s an assembly security issue. Optional permissions can be granted by the security policy set on the computer where the assembly will run. If you want your code to handle all potential security exceptions, you can do one of
Insert a permission request for all the permissions your code must have, and handle up front the load-time failure that occurs if the permissions are not granted.
Do not use a permission request to obtain permissions your code might need, but be prepared to handle security exceptions if permissions are not granted.
For your information, see:
http://msdn.microsoft.com/en-us/library/33tceax8(VS.71).aspx (For Security Policy)