Skip to content

Is building a specific project in a solution supposed to work? #149

Open

Description

@eriknilsontenstar

When I run msbuild.exe /t:AProjectInThatSolution /graph /reportfileaccesses the output looks like

  1. Starts up and runs the plugin like usual
  2. Build succeeds, 0 cache hits, 0 cache misses, NaN cache hit ratio

Is this the intended behaviour?

MSBuild page describing how to build a specific project in a solution https://learn.microsoft.com/en-us/visualstudio/msbuild/how-to-build-specific-targets-in-solutions-by-using-msbuild-exe?view=visualstudio

Activity

  1. dfederm commented on Jan 6, 2026

    @dfederm
    Member

    That should work. I suspect that something is wrong with the MSBuild graph build (which I also heavily contribute to), not necessarily the cache plugin.

    Are you able to provide a simple repo for the issue?

  2. eriknilsontenstar commented on Jan 7, 2026

    @eriknilsontenstar
    Author

    Hi dfederm, you are indeed correct that it does work! Until it doesn't... I don't understand these results:

    • In a minimal solution with 3 projects, building each project by itself works
    • In a "real" solution with 11 projects , building one of the library projects works This library project doesn't depend on any of the other projects.
    • In that same "real" solution, building the executable project does not work - gives Cache Hit Ratio NaN

    So, somewhere between the common library project and the executable it fails... Building the whole solution works as expected.

    Is there a way of debugging the graph or something to understand where it might be breaking?

    I'll build each of the 11 projects to see if there is a pattern to which break and which don't.

  3. eriknilsontenstar commented on Jan 7, 2026

    @eriknilsontenstar
    Author

    Ah, actually scratch that, building any single project in the "real" solution results in either:

    • a cache miss because of "Ignoring successful build for node COMPANYPROJECT_COMPANY.PROJECT.VCXPROJ_B.BIRF3RA1HPUD8CRMPNBA with non-successful dependency: COMPANYOTHERPROJECT_COMPANYOTHERPROJECT.VCXPROJ_B.BIRF3RA1HPUD8CRMPNBA
    • Cache Hit Ratio: NaN

    But building the whole solution does work, we've been running it in our CI now for a while and its made the job way shorter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions