shared classes/package in C#

  • Thread starter Thread starter Ryan Liu
  • Start date Start date
R

Ryan Liu

Hi,

I have common classes/packages to share by different sets of projects. Some
share by project A and B, some by project A and C.

What is the best practice to handle shared classes? Should I take each set
of common classes out and compile them to individual dlls, e.g. ab.dll.
ac.dll, together with A.exe, B.exe, C.exe?

That way I ends up lots of dlls(projects) and kind of annoying.

In Java, I just put them in a single source tree, compile them all together
and when I deploy, I can use script to pull out right *.class.

But in CSharp, it is compiled to one dll, not one to one class files.
 
The rough equivalent of .class files in .NET are "netmodules". Look them up
in MSDN if you want to go there.

Personally I don't see why lots of little DLLs are a problem. You don't even
have to load them into a VS.NET solution if they're fairly static and you
can use nANT or MSBuild to compile them instead.
 
Back
Top