Moving .NET assemblies away from the application base directory?
Posted
by RasmusKL
on Stack Overflow
See other posts from Stack Overflow
or by RasmusKL
Published on 2010-03-21T11:28:02Z
Indexed on
2010/03/21
11:31 UTC
Read the original article
Hit count: 325
.NET
|assemblies
I have a WinForms application with a bunch of third party references. This makes the output folder quite messy. I'd like to place the compiled / referenced dlls into a common subdirectory in the output folder, bin / lib - whatever - and just have the executables (+ needed configs etc) reside in the output folder.
After some searching I ran into assembly probing (http://msdn.microsoft.com/en-us/library/4191fzwb.aspx) - and verified that if I set this up and manually move the assemblies my application will still work if they are stored in the designated subdirectory like so:
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="bin" />
</assemblyBinding>
</runtime>
</configuration>
However, this doesn't solve the build part - is there any way to specify where referenced assemblies and compiled library assemblies go?
Only solutions I can think of off the top of my head is either post-build actions or dropping the idea and using ILMerge or something.
There has got to be a better way of defining the structure :-)
© Stack Overflow or respective owner