views:

166

answers:

7

Java provides the jar file so that all the class files and jar files are merged into one file. Does C# provide equivalent/similar functionality?

+10  A: 

.NET compiles into dll or exe. You can use ILMerge to merge several dlls/exes into one.

Svetlozar Angelov
+3  A: 

Aren't .NET assemblies just for this?

Remember, you can include resources, etc in it.

Also, assemblies could be combined using ILMerge, and for more complex scenarios you probably should better use ClickOnce or MSI deployment.

For silverlight, there's XAP packages, but I assume you're talking about desktop .NET.

wizzard0
+1  A: 

yes C# provides dll

Dynamic-Link Libraries

anishmarokey
To be more precise: Assemblies can be DLL or EXE files.
Brian Rasmussen
+2  A: 

It's called an "assembly".

http://en.wikipedia.org/wiki/.NET_assembly

Scott M.
+2  A: 

Not really, C# works with .dll and .lib. If you don't put everything in the same project (all source code), you won't be able to achieve what you probably want to do.

But with ILMerge, you can combine everything into 1 executable for easier distribution if you don't want to have a setup or a compressed file containing all the files needed..

AngeDeLaMort
+1  A: 

No, an assembly AFAIK can not include referenced assemblies.

onof
+1  A: 

The jar equivalent in C# (basically in any .Net language) is dll (for class library) and exe (for executable one) or collectively assembly. But one assembly can not include another assembly in the form of dll or exe. But ILMerge do merges two assemblies but not include one in another like jar file.

But there is project published in codeproject (http://www.codeproject.com/KB/install/NARLoader.aspx) you might get interested in. It do stuff like jar files with the .net assemblies.

Anindya Chatterjee