In "Programming .Net Components, 2nd Edition" (O'Reilly, July 2005, ISBN
0-596-10207-0) Juval Lowy shows how to do just want you want, assuming you
are in C# 2.0 (2005).
Section 2.2.8 of his book talks about a new attribute called
InteralsVisibleTo. In the AssemblyInfo.cs file, add this attribute:
[assembly: InternalsVisibleTo("YourDllOrExe")]
Any clients in the assemblies YourDllOrExe.EXE or YourDllOrExe.DLL will be
able to use any classes in your original dll and call both public and
internal members.
Haven't tried this yet myself, just happened to read about it last night so
it was good timing. It's more meant for situations where for whatever reason
a team decides to break a single DLL into multiple DLLs but parts in
different DLLs rely on internal members from the original.
Personally I think you ought to think about your design a bit, as you are
essentially exposing internal members and circumventing the whole of idea of
it being internal, but if you insist, well above is a way to do it.
Robert
<mm******@gmail.com> wrote in message
news:11**********************@u72g2000cwu.googlegr oups.com...
Hi,
I am trying to have a set of base classes and interfaces of an
application framework in their own assembly. That way, concrete
implementations of the API will reference that assembly and implement
the abstract classes and interfaces.
The problem is that some parts of the API are "internal" in the sense
that they are internal to the implementation. If I declare these parts
as internal in the API, the implementations will not be able to access
them.
The reason behind using "internal" members is to eliminate the need for
the proxy design pattern so I can pass objects between the implemation
and the GUI directly whilst ensuring that the appropriate access levels
are maintained.
Any thoughts?
Thank you,
----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----