Hello Ross,
Trying to prevent your assembly from showing in the IDE is most likely the
wrong way to go. First I don't believe there is a way to do it, but even if
there was, this would not prevent people from referencing it from outside
the IDE (by example if they call the compiler from the command line).
A better approach would be for the user of your assembly to need to "provide
a proof of authorisation" to your assembly before your assembly would
execute any code. Of course your code would have to be written in such a way
that it is hard to fake the authorisation. By example if your customer have
to register their product (possibly including dll/class name, Guid, file
size,...) and if you have a webservice that get called to validate all this
information when theirs user try to run the code that use your dll, this may
work. Of course this has some side effect (assume network access; too slow
if process is short lived, but fine if process is a long lived process that
can have longer initialization,...).
Keep in mind that making it hard to work around your protection mechanism
can be hard. For the example mentioned above, it would be easy to
disassemble your dll, so you would probably want to be using an obfuscator.
You could also consider emiting code on the fly, with some amount of
randomness to make it harder to get from memory. If you do the
authentification over the network, you need to use the right encryption,...
If you really want to invest in this, and you carefully thing about all the
way someone could work around your protection mechanism, you can make it
hard for people to use your dll without having a license.
Rusty

Signature
--
Rusty Deschenes [MSFT]
This posting is provided "AS IS" with no warranties, and confers no rights.
> Hi
>
[quoted text clipped - 16 lines]
> Thanks in advance.
> Ross
Ross Pellegrino - 29 Jul 2004 00:55 GMT
> Trying to prevent your assembly from showing in the IDE is most likely the
> wrong way to go.
*** I agree.
> better approach would be for the user of your assembly to need to "provide
> a proof of authorization" to your assembly before your assembly would
> execute any code.
*** This was exactly what I have done and it works great. I couldn't use a
LIC file, but rather, I created a *.resx file that contains an encrypted
128bit string. The developer must embed this file within their code. I was
hoping to not make the licensed developer do this, but its the only way to
protect my investment. In retro, I kind of like the idea now, because I can
encrypted things like: beta or release, version, expiry data, etc....
> Keep in mind that making it hard to work around your protection mechanism
> can be hard. For the example mentioned above, it would be easy to
> disassemble your dll,
*** I got around this problem by calling a classical DLL (not an assembly).
Within this dll, the actual key is hashed. Since my .NET components uses
many services embedded within the DLL via interop, an invalid hash key value
will return an exception. Besides, my component is only worth $150 not
worth the effort to break it just to use it :) I don't think
Thanks Rusty for your time. Your suggestions are all valid and in someway I
believe I've incorporated them in my method.
Ross
> Hello Ross,
>
[quoted text clipped - 49 lines]
> > Thanks in advance.
> > Ross