Generally you get this when the previous project fails to build. Try a clean build. Also ensure that you're using a project reference to the other project and not a binary reference. There is also the chance that it is related to using different target frameworks but you'd have to identify what changed between the working and non-working versions.
Getting a "could not be found" from the unit test project
Rod At Work
866
Reputation points
I've made some changes to a ASP.NET MVC Core (.NET 6) solution. There's two projects; the MVC project and a xUnit test. Suddenly today, I started to get this error:
CS0006 Metadata file 'C:\Repos\PW\PharmacyWarehouseV2\PharmacyWarehouseV2\obj\Debug\net6.0\ref\PharmacyWarehouseV2.dll' could not be found PharmacyWarehouseV2.Test
So, it is coming from the xUnit project PharmacyWarehouseV2.Test. And it's trying to find a DLL which the build is supposed to create. So, how do I get around MSBuild complaining about what it should be creating?