Tuesday, May 19, 2009

.NET Tricks - alterante folder for project assemblies

Few days back at work i came across a scenario in which i have lot of third party assemblies used by my C# windows application project, i wanted to put them in a separate sub folder instead of the main folder. By putting them in a sub folder it will make my life lot easier when it comes to deployment and other post release stuff.

Luckily .NET framework provides us with a tag in APP.CONFIG where we can specify the alternate folders to look for third party/ shared assemblies. Here is the code snippet that will ask the .NET framework to look into \bin and \shared folder for the shared assemblies instead of just the main folder where the exe is placed.