Re: Prevent DLL usage
- From: "Ben Voigt [C++ MVP]" <rbv@xxxxxxxxxxxxx>
- Date: Fri, 10 Apr 2009 16:43:08 -0500
"Pavel Minaev" <int19h@xxxxxxxxx> wrote in message news:8e051f55-4af9-433c-b571-accafc6f1c45@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Apr 9, 12:33 am, Chris Zopers <test123tes...@xxxxxxxxx> wrote:Aha, I didn't know the InternalsVisibleTo atribute yet, but I googled it
and it seems to do the trick too. Thanks!
Note that even for internal classes, there's nothing stopping a
FullTrust assembly from using reflection to instantiate your classes
and call their methods. FullTrust is precisely what the name implies -
no restrictions.
I'd neglected to consider instantiation through reflection. But even if that wasn't possible, there's always decompilers or patched runtimes to bypass security checks. The admin of the computer can always do anything.
Anyway, if all you want to achieve is to give a strong hint that your
assembly should not be used directly, then internal+InternalsVisibleTo
is probably the best way, since no-one can accidentally ignore that
(unlike CAS).
Know how the runtime penalty compares, between InternalsVisibleTo and CAS?
.
- Follow-Ups:
- Re: Prevent DLL usage
- From: Pavel Minaev
- Re: Prevent DLL usage
- References:
- Re: Prevent DLL usage
- From: Ben Voigt [C++ MVP]
- Re: Prevent DLL usage
- From: Chris Zopers
- Re: Prevent DLL usage
- From: Pavel Minaev
- Re: Prevent DLL usage
- Prev by Date: Re: about the Just-In-Time(JIT) compiler
- Next by Date: Re: Visual Studio Professional Edition purchase
- Previous by thread: Re: Prevent DLL usage
- Next by thread: Re: Prevent DLL usage
- Index(es):
Relevant Pages
|