CSC : error CS0006: Metadata file '…\<dependency_file_name>' could not be found.
If the platform or configuration name properties are not found in the solution file, the step of scanning for dependencies is skipped. Thus, the dependency relationships are not maintained and projects may build out of order.
MSBuild produces the temporary solution object with everything at the same dependency level, then builds it with the properties specified.
There are several workarounds available depending on different scenarios:
1. Modify the solution file (which may contain a mixture of project types) so that it contains a configuration that matches the name to be passed on the command line.
2. In the .xml file, instead of using the MSBuild task, use the Exec task to launch msbuild.exe on the solution.The potential disadvantages of this are that logging won’t work so well. Also the multiprocessor build will not be synchronised.
3. Build the solution file directly, i.e. msbuild.exe mysolution.sln /p:xx=yy ... without an .xml file involved.
4. Build all the projects in the solution with the MSBuild task in the .xml file instead of building the .sln file.
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, MICROSOFT AND/OR ITS SUPPLIERS DISCLAIM AND EXCLUDE ALL REPRESENTATIONS, WARRANTIES, AND CONDITIONS WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO REPRESENTATIONS, WARRANTIES, OR CONDITIONS OF TITLE, NON INFRINGEMENT, SATISFACTORY CONDITION OR QUALITY, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THE MATERIALS.
Article ID: 964125 - Last Review: Jan 22, 2009 - Revision: 1