ILMerge without the "merge".
Simple NuGet package that does two things:
- Adds a class that provides an overload the AppDomain.CurrentDomain.AssemblyResolve event, and some code to load assemblies out of resources. For more details have a look here and here
- Adds an MSBuild target that embeds all required assemblies into the output file as a set of Resources for resolution by the class above.
This essentially means that you automatically get an assembly/exe out of your build that has the required code and all required dependencies "bundled" together, without any IL merging.
- Add the ILBundle package to your output project. This will add the ILBundle.cs class and the ILBundle.targets MSBuild target (at least, it should!).
- Add a call to ILBundle.RegisterAssemblyResolver() to your main entry point. This pretty much has to be the first thing that runs. Also better if anything that requires a dependent assembly does not run in the same method.
- Mostly works on my machine.
- Not saying it will work on yours.
- May break random bits of your world, but that is unintentional.
- Consider it a cute hack that generally just seems to work, but sometimes won't.