Best Way to Avoid Errors due to Settings/Configuration BEFORE Runtime
<p>A common problem is that programs may compile ok, but external (user/environment) settings may cause applications to crash during runtime.</p>

<p>Aside from performing checks all over the code, (alas actually performed during Runtime), 
I would like to have rule sets to assert <strong>during build</strong> that, at least default values settings, are coherent.</p>

<p>The simplest case may be, if default settings are hardcoded  : </p>

<pre><code>Directory defaultDir = new Directory("D:\\Data");
UserLogin usr1 = "Jesse";
UserLogin usr2 = "James";
</code></pre>

<p>(yeah, "Booh"; this is an example, please <strong>DO NOT</strong> comment/answer on that unsignificant detail... I know it's hard for some of you, but please REFRAIN ! :-) )</p>

<p>So, is there a SIMPLE way to check DURING Build, that "D:\Data" exists, and that usr1 and usr2 do have different login strings etc...</p>

<p>I am sure there are assertion mechanisms in .Net, and maybe Unit Testing (I'd rather avoid the latter cause it may be oversized for the very light usage/need in this particular case. But I guess that's what Unit Tests are designed for too...)</p>
