Re: Having trouble understanding assemblies

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Jon Skeet [C# MVP] (skeet_at_pobox.com)
Date: 06/22/04


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


Relevant Pages

  • Code Centralization
    ... Code must reside in the vb editor. ... DLL's are data link ... >Perhaps a VB6 DLL or VB.NET addin. ...
    (microsoft.public.excel.programming)
  • Re: MASM as an addition to the VC Express edition now available
    ... Why do you write your editor and debugger yourself, ... Call for an Edit DLL? ... Because it is simpler than to rewrite our own from ... syntax, modify the HLA source to make your own "preparser" ...
    (alt.lang.asm)
  • Re: Having trouble understanding assemblies
    ... > 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. ... editor app is in a different assembly so that doesn't work. ...
    (microsoft.public.dotnet.framework)
  • Re: Stripping functions from a DLL - offer wanted
    ... Sure, I am subtracting the image base address, of course. ... 1) If RosAsm is able or not (it may ... to recompile the DLL. ... Inside RosAsm Editor, ...
    (alt.lang.asm)
  • Re: Dumbass user or problem with regsvr32
    ... I decomissioned my last Win16 machine in 1999; I needed it to check out legacy code, ... I'm disinclined to ever develop another app to run on MS-DOS. ... that a client needs validation that the app can run on 4.0. ... >I once had similar errors because i was trying to register a dll on Win98 ...
    (microsoft.public.vc.mfc)