[ACCEPTED]-How to move all referenced DLLs into seperate folder in c#?-setup-project

Accepted answer
Score: 13

You can use the <probing> element in the app.config file 10 to specify a private path for Fusion (the 9 assembly loader) to search in.

This allows 8 you to specify paths that are sub-paths 7 of your application directory which Fusion 6 should search when trying to find assemblies 5 to bind to. An example (taken from the 4 documentation page) is:

      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
         <probing privatePath="bin;bin2\subbin;bin3"/>

This means that Fusion 3 will search in the bin, bin2\subbin (but 2 not bin2, IIRC) and bin3 subdirectories 1 for assemblies when trying to bind to them.

Score: 4

I wrote a nuget package, called PrettyBin for this 3 purpose It addes a post build target to 2 a project, that moves dlls to a "lib" subfolder, and 1 modifies app.config to look there

More Related questions