Have you ever wanted a more elegant deployment solution than dumping all the files into a single folder?

One of the great advantages of the .NET platform is its incredible depth. This is also an incredible problem, as there is so much to know - and it’s very easy to miss things that have been there for several releases. Here’s one example - probing paths.

For a project at work, I build a commandline client, designed to exercise the core services without much overhead.

I wasn’t happy with the deployment folder, as it wasn’t that clear which file should be executed.

Fortunately, I was able to move all the supporting assemblies into a bin subfolder just by adding a bit of configuration to my .config file:

<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <probing privatePath="bin"/>
    </assemblyBinding>
  </runtime>
</configuration>

This configures the main AppDomain to also look for any required assemblies in a \bin\ folder underneath the main folder for the application, giving me this result:

For a simple application like this, the difference is more esthetic than anything else … but for a more complex application with many supporting assemblies, this can help you tidy up your deployment structure so it’s a bit less untidy.

Comments

blog comments powered by Disqus
Next Post
Powershell Prompts  12 Dec 2013
Prior Post
The importance of reporting a bug  03 Nov 2013
Related Posts
Checklists, Automation and Consistency  19 Jul 2015
Wix and the Remember Property pattern  07 Aug 2013
WiX Techniques Updated  30 Oct 2008
WiX Techniques  12 Sep 2008
NAnt and WiX Versioning  27 Aug 2008
Archives
November 2013
2013