Reputation: 324
I’m in the process of migrating a large monolith repository to MSBuild. While running the command msbuild dirs.proj
from the src folder, I encounter numerous errors like the following:
CSC : error CS0006: Metadata file 'C:\Users\sharmapulkit\source\AI-REPO\src\ccm\shared\QueueOperations\bin\x64\Debug\net472\QueueOperations.dll' could not be found.
However, I can successfully build each project individually and generate the DLLs by running: msbuild <project-name>.csproj
For example, I have a project DataFetchOperations.csproj
that depends on QueueoOerations.csproj
:
<ProjectReference Include="..\QueueOperations\QueueOperations.csproj">
<Project>{D358A79C-8DB6-4343-B142-24D2E82B72E7}</Project>
<Name>QueueOperations</Name>
</ProjectReference>
When I run msbuild DataFetchOperations.csproj
, I get a missing DLL error for QueueOperations.dll. However, if I build QueueOperations.csproj
separately first, I can successfully build DataFetchOperations.csproj
afterward.
My understanding of dirs.proj: My understanding is that if MSBuild finds that Project A has a dependency on Project B, it should first build Project B and then Project A. However, this is not happening in my case.
My questions are:
Do I need to maintain the build order of projects in the dirs.proj file?
Am I missing something basic in my dirs.proj or .csproj files that is causing these metadata file errors?
How can I resolve these dependency issues to build the entire repo at once?
Additional Information:
Any advice or pointers would be greatly appreciated!
Upvotes: 0
Views: 49