Reputation: 1567
Can an Assembly contain an exe?
I have a program that generates an exe but also uses a .dll that I created. Is a multi-file assembly?
EDIT:
So what is this I read about multi-file assembiles in .NET? Could those contain an .exe and .dll?
Upvotes: 1
Views: 310
Reputation: 5867
This SO post describes the difference between a single-file assembly
and a multi-file assembly
. Here's a snippet from that post to answer your updated question:
Question:
What is this I read about multi-file assemblies in .NET?
Answer:
With command line compilers, you can split an assembly into multiple parts - where a single assembly's Manifest contains the information required to find information that's part of the assembly, but stored in a separate file. For example, you can keep a resource image (ie: a .bmp) that is a large resource in its own file, so that it isn't necessary to load it just to open the assembly. Creation of multi-file assemblies is not supported by Visual Studio, but these will look like a DLL or EXE, plus zero or more netmodule files, plus zero or more resource files (which can be anything). The main DLL or EXE contains the manifest that specifies where the other files are located. The steps required to build this are detailed in How to: Build a Multifile Assembly.
Upvotes: 1
Reputation: 1503379
No, if you've got a .exe file and a .dll, those are two separate assemblies.
If you want to have just one file, you could try using ILMerge (direct download, NuGet) to combine the two.
Upvotes: 6
Reputation: 17603
Use ILMerge as proposed by Jon Skeet:
ilmerge.exe /target:winexe /out:bothassemblies.exe assembly1.exe assembly2.dll
Upvotes: 1