How is it that I could compile an exe in C# with no error but execution fails with dll not found?
<p>I have created a console app referencing <a href="http://www.antlr.org/download/CSharp" rel="nofollow">http://www.antlr.org/download/CSharp</a></p>

<pre><code>using System;

using Antlr.StringTemplate;
using Antlr.StringTemplate.Language;
</code></pre>

<p>That I want to compile by command line with</p>

<pre><code>csc /r:c\antlr\antlr.runtime.dll;c\antlr\StringTemplate.dll myprog.cs
</code></pre>

<p>It created the exe but when executing it says it cannot find StringTemplate or dependencies why ? I have all dll package in same directory.</p>

<p>Update: the same program build under visual studio works but I need to do this by command line.</p>

<p>Update 2:  even copied to exe path it still can't find them weird !</p>

<p>Update 3: ok finally works I confused visual studio bin output and my csc output dir.</p>
