strong name exception on SecurityAction.Demand, works fine for LinkDemand

J

Joe Abou Jaoude

Hi,
I have a component that is protected by the
StrongNameIdentityPermission.
I m calling this component from a web application that has the
appropriate strong name.
I noticed that calling the component fails when the
SecurityAction.Demand is on, while it succeeds when
SecurityAction.LinkDemand is on.
Since I m calling the component directly from my application, I was
wondering , what could be in the method stack that is causing the demand
to fail.
Is there a way to make it work ?

Regards
 
D

Dominick Baier [DevelopMentor]

Hi,

you know that SNIP really only has teeth when the client is partially trusted?

- in fact the behaviour has changed in 2.0 that fully trusted code always
passes SNIP demands.

i wouldn't invest in this feature.

but this doesn't answer your question -

a demand triggers a full stack walk

i guess you signed your code behind assembly?

so the page class (not signed) derives from the code behind class (signed)
to call into a SNIP demand - the stack walk fails when the page class is
reached.
 
J

Joe Abou Jaoude

ah ok, I got it.
so it's not an issue for web applications only, but also to windows
application since a windows form inherits from Form class. so basically,
SecurityAction.Demand won't work in any case
 
D

Dominick Baier [DevelopMentor]

Hi,

it is not a problem of inheritance but that the page is in a different assembly
than the code behind - and the originally calling assembly is not strong
named.

In WinForms it would work - but you usually only use LinkDemand with SNIP
- and only in partial trust.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,145
Messages
2,570,825
Members
47,371
Latest member
Brkaa

Latest Threads

Top