Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to compile a dll with subset of classes from the class library project?

Tags:

c#

dll

Say we have a class library project containing 10 classes. Now I want to create a dll which should contatin only 6 classes out of those 10. How we can achieve this?

like image 483
Myth Avatar asked Jan 23 '23 20:01

Myth


1 Answers

You could use compiler directives. E.g.

#define ClassA
#if ClassA
class A
{
}
#endif

#undef ClassB
#if ClassB
class B
{
}
#endif

Class A would be included and Class B would not.

like image 167
Adam Ralph Avatar answered Jan 29 '23 16:01

Adam Ralph