Click here to Skip to main content
16,005,339 members
Home / Discussions / C#
   

C#

 
GeneralRe: Drawing Problem Pin
Heath Stewart25-Jun-04 4:25
protectorHeath Stewart25-Jun-04 4:25 
GeneralRe: Drawing Problem Pin
Karl 200027-Jun-04 9:19
Karl 200027-Jun-04 9:19 
GeneralThe Thread Security Of It All Pin
MKlucher24-Jun-04 18:07
MKlucher24-Jun-04 18:07 
GeneralRe: The Thread Security Of It All Pin
LongRange.Shooter25-Jun-04 2:52
LongRange.Shooter25-Jun-04 2:52 
GeneralRe: The Thread Security Of It All Pin
Heath Stewart25-Jun-04 4:03
protectorHeath Stewart25-Jun-04 4:03 
GeneralRe: The Thread Security Of It All Pin
Heath Stewart25-Jun-04 4:10
protectorHeath Stewart25-Jun-04 4:10 
GeneralRe: The Thread Security Of It All Pin
MKlucher25-Jun-04 8:02
MKlucher25-Jun-04 8:02 
GeneralRe: The Thread Security Of It All Pin
Heath Stewart25-Jun-04 8:32
protectorHeath Stewart25-Jun-04 8:32 
An application can only tell the CLR what it needs to run. It can't grant itself permissions; that would defeat the purpose. Do you trust someone just because they say they're trustworthy? I certainly don't.

If you use an assembly-level permission attribute, the assembly is not even executed so you can't handle an exception (unless you're a different assembly trying to use a type defined in that assembly, when it's loaded for the first itme - you really have to understand how the CLR works).

You can grant your assembly or assemblies FullTrust permission (again, that's a big cop-out and not a very good idea) if you use assembly evidence to match up with membership conditions for a code group. Assembly evidence is strong name identity evidence and publisher (x.509) evidence. If you add a CodeGroup using either of those membership conditions, then your assembly will be granted whatever permission set you choose. If you use host-based evidence like URLs or site, then an assembly matching that evidence will be granted those permissions.

A codegroup is installed into a machine's policy, yes, which is why you have to install it onto all machines. This is no different that ActiveX security (what little there is) policies and Java sandbox policies. This can be distributed through Windows Installer packages, batch files, start-up scripts, whatever. Distributing a policy is not hard if you no what you're doing.

Don't just read the article; read the other links I gave you as well. The article here on CodeProject explains Code Access Security, but there's more information about setting up code groups and why.

 

Microsoft MVP, Visual C#
My Articles
Questionspeed of Dataset and DataReader? Pin
jzb24-Jun-04 16:33
jzb24-Jun-04 16:33 
AnswerRe: speed of Dataset and DataReader? Pin
Colin Angus Mackay24-Jun-04 22:20
Colin Angus Mackay24-Jun-04 22:20 
Generalquestion of ImageList Pin
jzb24-Jun-04 16:28
jzb24-Jun-04 16:28 
GeneralRe: question of ImageList Pin
bneacetp24-Jun-04 21:27
bneacetp24-Jun-04 21:27 
GeneralRe: question of ImageList Pin
Dave Kreskowiak25-Jun-04 4:46
mveDave Kreskowiak25-Jun-04 4:46 
Question.NET Remoting, Client side reference server side? then how distribute? Pin
fayth24-Jun-04 16:11
fayth24-Jun-04 16:11 
AnswerRe: .NET Remoting, Client side reference server side? then how distribute? Pin
Xiangyang Liu 刘向阳24-Jun-04 16:54
Xiangyang Liu 刘向阳24-Jun-04 16:54 
GeneralRe: .NET Remoting, Client side reference server side? then how distribute? Pin
Heath Stewart25-Jun-04 3:59
protectorHeath Stewart25-Jun-04 3:59 
GeneralRe: .NET Remoting, Client side reference server side? then how distribute? Pin
Xiangyang Liu 刘向阳25-Jun-04 15:41
Xiangyang Liu 刘向阳25-Jun-04 15:41 
GeneralRe: .NET Remoting, Client side reference server side? then how distribute? Pin
Heath Stewart26-Jun-04 13:53
protectorHeath Stewart26-Jun-04 13:53 
GeneralRe: .NET Remoting, Client side reference server side? then how distribute? Pin
Xiangyang Liu 刘向阳27-Jun-04 0:28
Xiangyang Liu 刘向阳27-Jun-04 0:28 
AnswerRe: .NET Remoting, Client side reference server side? then how distribute? Pin
Allen Anderson24-Jun-04 17:10
Allen Anderson24-Jun-04 17:10 
GeneralRe: .NET Remoting, Client side reference server side? then how distribute? Pin
fayth24-Jun-04 20:19
fayth24-Jun-04 20:19 
GeneralRe: .NET Remoting, Client side reference server side? then how distribute? Pin
Xiangyang Liu 刘向阳25-Jun-04 15:47
Xiangyang Liu 刘向阳25-Jun-04 15:47 
GeneralToolboxBitmap Icon Pin
The_Soul_Of_Rock24-Jun-04 14:48
The_Soul_Of_Rock24-Jun-04 14:48 
GeneralRe: ToolboxBitmap Icon Pin
Heath Stewart25-Jun-04 3:57
protectorHeath Stewart25-Jun-04 3:57 
GeneralConverting byte[] to Hex String; Pin
Bo Hunter24-Jun-04 12:27
Bo Hunter24-Jun-04 12:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.