Discovered from a report of bad behaviour on Reddit: https://www.reddit.com/r/Blazor/comments/1imjygr/rz10012_components_from_razor_class_library_not/
We don't handle it well when there is a Razor Class Library, and the solution is not in the parent folder.
So for example given this layout:
App\
App\
App.csproj
App.sln
RCL\
RCL.csproj
RCLs don't have an absolute BaseIntermediateOutputPath, so we end up seeing <current directory>\obj as the obj path, and we have a Directory.Exists check that catches if that happens, and falls back to different logic for an RCL. Turns out current directory is the solution folder, and so that obj path does exist, but it exists for a different project, and then all sorts of fun shenanigans ensue.
A workaround is to move the sln file up a level. ie:
App\
App.sln
App\
App.csproj
RCL\
RCL.csproj