views:

115

answers:

1

My case: I have an app.exe and several dlls for it -- a.dll, b.dll, c.dll, etc (they come from single VS solution which consists of many projects). I would like to merge (ilmerge) all dlls into one so I would have: app.exe + x.dll.

Now, there is a problem -- the application expects to have all dlls so when I put just single file x.dll it won't run. So how to "redirect" application to use one x.dll -- is it possible at all?

The one solution I am aware is deleting all references to projects in Visual Studio and add instead reference to merged dll. But this would disable dependency chaining while recompiling solution.

Btw. I cannot merge exe and dlls together because this is a wpf app, and ilmerge cannot handle it.

+1  A: 

You could instead of creating 3 DLLs you could create 3 .NetModules and turn them into one DLL. It would require some editing of the actual CSPROJ files because creating .NetModules is not currently integrated into the MSBuild system, but it can be done.

You can think of a .NetModule as a kind of static library in C/C++. Of course there are differences but overall the concept is similar. They are most common when trying to make a single DLL containing multiple .NET languages, but they will work for you as well. Check them out here.

linuxuser27
Thank you very much. Since my project is not so big instead of learning MSBuild I simply created one big project with files from others projects added into subdirectories as links. Kind of ugly, but requires almost no manual alterations, it is quick, it works :-)
macias