Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why am I missing assemblies from the bin directory when compiling with MsBuild?

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

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

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

My command line is simply:

msbuild.exe d:\myproject\mysolution.sln
like image 728
Carl Avatar asked Nov 27 '22 12:11

Carl


1 Answers

I have found various references to this problem scattered around the Net - and I've just come across it myself. Apparently MSBuild on the command line isn't as good at tracing chains of dependencies as the IDE is.

So as I understand it, if A depends on B which depends on C, The command line may not realize that A depends on C.

The only solution I've found is to ensure that you manually set the project dependencies so that the ASP project references everything it depends on - don't expect it to be able to figure them all out on the command line. This has worked for me, although I only have 5 projects so it's not a bind to get going.

I hope this helps.

like image 182
George Sealy Avatar answered Dec 05 '22 02:12

George Sealy