views:

977

answers:

5

What is the difference between Assembly and a DLL? While sending the code to a remote client, should a DLL file be sent or should a Assembly be sent (When direct TCP connection is available between two)?

+4  A: 

Well, a .NET dll is an assembly, but .NET exe's can be assemblies as well, so that means that all .NET dlls are assemblies, but the reverse is not true.

You shouldn't be sending actual code to a client. Rather, you should have the type definitions on both sides (client and server) and send serialized instances between the two.

casperOne
Except for native DLLs; I don't know that I'd consider those "assemblies" as the term here seems to be more of a .NET usage.
BobbyShaftoe
@BobbyShaftoe: I've updated the answer to specify .NET assemblies.
casperOne
@capserOne - Can you please elaborate on "serialized instances"?
Pushkar
@Pushkar: Why are trying you push an entire assembly over the wire?
casperOne
@Casper - I m trying to implement a Remote Entrusting mechanism which requires mobile modules to be sent to client machines. We cannot send COMPLETE mobile EXE hence decided to send code - again cannot send it uncompiled. So had to compile it to DLL and send. Thought it will be better with assembly.
Pushkar
A: 

Well, "assembly" is a term used for a .NET resource. This not necessarily a DLL. A DLL can be a .NET resource but it can also be a "native" resource as well. An assembly can be packed in a DLL or in an EXE. It just depends on the particular assembly.

If this is like your other question, you need to send the file that contains the assembly. You might be able to do something more complicated but it will be just that.

BobbyShaftoe
A: 

An assembly is the pre-compiled code which will be passed into a the .net JIT Runtime.

It is a machine independent format for the code which can be run by any .net Command Lanuage Runtime.

DLLs and EXEs are the common formats for assemblies.

Craig Warren
+3  A: 

An assembly is .NET's "minimum unit of deployment". Usually an assembly corresponds to a single file, but it doesn't have to - you can have multiple files, with one of them being the master which knows where all the other bits are.

Single-file assemblies are usually DLLs or EXE files. If you've got a normal class library and you just want to send it to the other side, the DLL is what you want. I'd only worry about more complicated scenarios as and when you run into them :)

Jon Skeet
@John- Please check my other question http://stackoverflow.com/questions/674194/transfering-assembly-over-tcp
Pushkar
A: 

.Exe 1.These are outbound file. 2.Only one .exe file exists per application. 3. .Exe cannot be shared with other applications.

.dll 1.These are inbund file . 2.Many .dll files may exists in one application. 3. .dll can be shared with other applications.

gujji