Re: Having trouble understanding assemblies
From: Jon Skeet [C# MVP] (skeet_at_pobox.com)
Date: 06/22/04
- Next message: mikeb: "Re: Root namespace"
- Previous message: kammj: "Using Excel as a datasource without losing records"
- In reply to: RichM: "Having trouble understanding assemblies"
- Next in thread: Marc Scheuner [MVP ADSI]: "Re: Having trouble understanding assemblies"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 22 Jun 2004 20:13:19 +0100
RichM <RichM@discussions.microsoft.com> wrote:
> I have an editor exe and a dll written in C#. The editor exe is
> closely related to the dll and needs full access to it. However, the
> dll will also be used in a more limited fashion by client
> applications other than the editor application. I would like to use
> the 'internal' keyword on my dll's classes so that only the editor
> app can have access to some things, but my editor app is in a
> different assembly so that doesn't work. My editor app is not a
> 'client' to my dllin the same way other apps would be.
>
> Can I use the 'internal' keyword to provide access to my app if I
> create a multifile assembly?
Yes.
> How do I get my IDE to do this? I can't figure it out.
I don't believe VS.NET really supports multi-file assemblies.
> How do I handle this situation?
Well, you could:
1) Build your editor and DLL as a single project instead
2) Allow access to the DLL's functions to all clients, and just not
worry about it
3) Not publish the documention to the parts of the DLL you don't want
other clients to have access to
4) Use some complicated trust model where the DLL will only "trust"
your client, which would be signed with a crypto key. (This would, I
believe, only give runtime security, not compile-time checking, and
would be quite complicated. I don't know much about it.)
Personally I'd favour option 2.
-- Jon Skeet - <skeet@pobox.com> http://www.pobox.com/~skeet If replying to the group, please do not mail me too
- Next message: mikeb: "Re: Root namespace"
- Previous message: kammj: "Using Excel as a datasource without losing records"
- In reply to: RichM: "Having trouble understanding assemblies"
- Next in thread: Marc Scheuner [MVP ADSI]: "Re: Having trouble understanding assemblies"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|