Re: WebPermission.Demand() is failing with membership condition - Strong Name



are you using internet explorer 7?

--

http://search.goldwatches.com/?Search=Movado+Watches
http://www.goldwatches.com/
http://www.jewelerslounge.com/
"dave" <dp_israel@xxxxxxxxx> wrote in message news:adbaef5c-d37a-4faa-9e46-bd48506f677b@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hi,
I'm trying to run an assembly in internet explorer (local mode - smart
client architecture).
I need to secure the running, so the first step is protecting the URL.
In .net framework 2.0 configuration I go to ->runtime security policy -
Machine -> Code Groups I adding new code group.
In the security permissions the Assert is Yes, and the membership
condition is URL with http://127.0.0.1/* , and then the following code
is working:
WebPermission webPerm = new
WebPermission(PermissionState.Unrestricted);
webPerm.Demand();

The second step is protecting it more with the Strong name of the
assembly.
In .net framework 2.0 configuration I go to ->runtime security policy -
Machine -> new Code Groups, and the membership condition is Strong
Name with the public key of the assembly. The following code is
failed:
WebPermission webPerm = new
WebPermission(PermissionState.Unrestricted);
webPerm.Demand();

this code is also failing:
WebPermission webPerm = new
WebPermission(PermissionState.Unrestricted);
webPerm.Assert(); // bypass the AppDomain level in stackwalk
webPerm.Demand();

what I need to do for solving this problem?

Thank you,
Dov

.