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
Browsers and WSL  31 Mar 2024
Factory methods and functions  05 Mar 2023
Using Constructors  27 Feb 2023
An Inconvenient API  18 Feb 2023
Method Archetypes  11 Sep 2022
A bash puzzle, solved  02 Jul 2022
A bash puzzle  25 Jun 2022
Improve your troubleshooting by aggregating errors  11 Jun 2022
Improve your troubleshooting by wrapping errors  28 May 2022
Keep your promises  14 May 2022
Archives
November 2013
2013