<p>I have a solution which contains many class libraries and an ASP .NET website which references those assemblies.</p>

<p>When I build the solution from within the IDE, all assemblies referenced by the website end up in the bin directory. Great!</p>

<p>When I use MsBuild from the command line, all the referenced assemblies are not copied to the bin directory. Why?</p>

<p>My command line is simply:</p>

<pre><code>msbuild.exe d:\myproject\mysolution.sln
</code></pre>

Which msbuild are you referencing? Is it the right one?
I generally call like this (from a batch file):
%WINDIR%\Microsoft.NET\Framework\v3.5\msbuild.exe deploy.proj /v:n
In this example, deploy.proj is just a regular msbuild file that does some other stuff before and after calling msbuild on the .sln file.