Brandon Michael Hunter
Brandon Michael Hunter

Reputation: 1221

How to compile separate assemblies for each class file in my class library

I have a class library with a bunch of classes and I would like to compile each of my classes into its own assembly. Is that possible?

Upvotes: 0

Views: 980

Answers (3)

MotoWilliams
MotoWilliams

Reputation: 1568

You might have to do some msbuild gymnastics but this might get you started on your way.

Stack Overflow - Visual studio one project with several dlls as output?

Upvotes: 3

CesarGon
CesarGon

Reputation: 15345

It is possible. A separate assembly is created when you compile your solution for each project that exists in Visual Studio, so you only need to create a project per class to obtain what you want.

Having said that, I am not sure that having one assembly per class is a good thing to do. Loading assemblies at run-time is expensive, and managing them at design-time requires some effort too. Would you care to elaborate on why you need such a thing?

Upvotes: 3

Hans Passant
Hans Passant

Reputation: 942368

I would have to guess your real question is "can it be done automatically?" No, you have to create a project for each assembly. Quite a maintenance and deployment nightmare with no easily conceivable advantages.

Upvotes: 2

Related Questions