uzay95
uzay95

Reputation: 16642

How to compile cs files into separate dll

I have a class library and cs files which are for different objectives. One is extension class, the other is windows form control the other is asp.net control, etc.

I want to compile all these cs files into a different dll.

PS: Some of them will need more than one class files maybe.

Upvotes: 1

Views: 5130

Answers (4)

KV Prajapati
KV Prajapati

Reputation: 94653

You may try command line compilation. (Working with the C# 2.0 Command Line Compiler)

csc /target:library /out:Something.xyz *.cs

Upvotes: 1

Nitin Kumar
Nitin Kumar

Reputation: 109

All *.cs in a single class library project will compile into the same DLL, you can not split them into individual dlls. If you want a seperate dlls for each class then each should be in a seperate class library project.

Upvotes: 0

Youp Bernoulli
Youp Bernoulli

Reputation: 5654

You have to create different projects in your solution (assuming you work in Visual Studio).

Each project can have multiple (class, resource, form, etc.) files and will be compiled into different assemblies (dll's). For each project you can specify settings (assembly name, target framework, etc.).

Classes from different projects can "use" each other by making references from one project to the other. Also, different projects can specify the same namespaces so that you can structure the aplication to your own wishes.

See Structuring Solutions And Projects

Upvotes: 0

Matt Roberts
Matt Roberts

Reputation: 26917

I know this sounds too obvious, but if you want to compile them into seperate DLLs, why don't you create a project per assembly? So that's a project for the extension classes, one for the asp.net controls etc...

Upvotes: 1

Related Questions