Actually, ignore the second paragraph of my last post entirely. The
framework almost certainly doesn't need an assertion to prevent the deny
from working since there's no need for ReflectionPermission to be evaluated
after the target is loaded. In fact, to be consistent with the other
permissions, stack walk modifiers on the target class or member should
probably be ignored. For example, a file doesn't get to specify a modifier
for a FileIOPermission (ignoring the fact that there's no mechanism in place
for this <g>), so why should code get to specify a modifier for
ReflectionPermission? Doesn't mean I necessarily like the behaviour, but
there is a certain logic to it.
"Nicholas Paldino [.NET/C# MVP]" <mvp@spam.guard.caspershouse.com> wrote in
message news:%23JGr6f6iEHA.2500@TK2MSFTNGP15.phx.gbl...
[quoted text, click to view] > pnp,
>
> Even if you were able to hide it from an object browser, the metadata
> for the interface could still be read (if you have to make it public, then
> there is nothing you can do about this).
>
> However, if you are dealing with object browsers that use the
> Reflection API, then you can probably place a ReflectionPermission
> attribute on your types, denying the permission. This should offer some
> sort of protection.
>
> Hope this helps.
>
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> - mvp@spam.guard.caspershouse.com
>
> "pnp" <pnp.at.softlab.ece.ntua.gr> wrote in message
> news:e9hyWa6iEHA.3876@TK2MSFTNGP15.phx.gbl...
>> The problem is that it has to be public because it is being used by other
>> assemblies... The need to hide it is for security reasons.
>>
>> Can anything be done?
>>
>>
>>
>> "Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us>
>> wrote
>> in message news:uhbqIX6iEHA.2664@TK2MSFTNGP11.phx.gbl...
>>> Hi,
>>>
>>> Do not make it public.
>>>
>>> Cheers,
>>>
>>> --
>>> Ignacio Machin,
>>> ignacio.machin AT dot.state.fl.us
>>> Florida Department Of Transportation
>>>
>>>
>>> "pnp" <pnp.at.softlab.ece.ntua.gr> wrote in message
>>> news:OGQZ9H6iEHA.3148@TK2MSFTNGP10.phx.gbl...
>>> > Is there an attribute (or another method) to hide an interface (in a
>> dll)
>>> > from being seen from the object browser while browsing a dll?
>>> >
>>> > Thanks in advance,
>>> > pnp
>>> >
>>> >
>>>
>>>
>>
>>
>
>