Met this metadata file XYZ.dll not found error a few weeks ago, and spent quite some on figuring out what was going on. Followed the thread [1, 2], tried most popular approaches, and still cannot fix it.

In the end, I began to try cold leads. Some users mentioned to check the output window [1, 2], as quoted

for any reason, did not show up in the error window. Because of that, the VS build system seemed to miss the error and tried to build depending projects, which in turn failed with the annoying metadata message … First look at your Output Window! …

I looked at the output window before, and didn’t find anything special. Anyway, it wouldn’t hurt to try again. With special attention to output window, I was surprised to find there was really an error message hidden among other regular messages in output window, followed this lead, and fixed the metadata file not found error.