|
security
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
full trus and 1.1 SP1If I set my security level to no trust, my .NET application will now actualy execute until Application.Run (previously, it wouldn't even start up without execute permission) So great I thought - I can put up a friendly dialog for my users if I dont have full trust. so I added the following code PermissionSet fullTrust = new PermissionSet(PermissionState.Unrestricted); try { fullTrust.Demand(); } catch(SecurityException) { However, this demand succeeds even if I am running under no trust - why is this? Thanks Andrew "AndrewEames" <AndrewEa***@discussions.microsoft.com> wrote in message This seems rather unlikely. It might be a good idea to confirm whether your news:B5DEB5D5-E5DB-4D4F-9F22-31AE8438A147@microsoft.com... >I just applied 1.1 SP1 and I am seeing some changes in behavior wrt. >security > > If I set my security level to no trust, my .NET application will now > actualy > execute until Application.Run (previously, it wouldn't even start up > without > execute permission) application is truly being granted no permissions at all (http://support.microsoft.com/kb/815170/EN-US/). If it really isn't being granted SecurityPermission\Execution, could you please post short but complete sample code (http://www.yoda.arachsys.com/csharp/complete.html) for an application that demonstrates this? Show quote > So great I thought - I can put up a friendly dialog for my users if I dont Probably because the demand applies only to callers, but not to the method > have full trust. so I added the following code > > PermissionSet fullTrust = new > PermissionSet(PermissionState.Unrestricted); > try > { > fullTrust.Demand(); > } > catch(SecurityException) > { > > However, this demand succeeds even if I am running under no trust - why is > this? in which it is used. Try moving the demand into a separate method called from within your Main method. Show quote > Thanks > Andrew > > |
|||||||||||||||||||||||