Pulkit Sharma
Pulkit Sharma

Reputation: 324

Error CS0006: Missing Metadata File in Large Monolith Repo Migration to MSBuild

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:

Additional Information:

Any advice or pointers would be greatly appreciated!

Upvotes: 0

Views: 49

Answers (0)

Related Questions