4

I'm getting only this error on build:

Blazor Metadata file '..Proj\obj\Debug\net6.0\ref\Proj.dll' could not be found

The solution was building yesterday last time I closed it, I can discard all my changes in git and I'm still getting this error.

Last change I made was adding <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles> in my project file (following this: https://stackoverflow.com/a/71179023/11783857 ), but now even after removing this I'm still getting the same error.

There aren't any other errors showing, only the metadata file could not be found.

buga
  • 852
  • 9
  • 21

2 Answers2

5

I unloaded all the other projects that were building and I was getting only build failed for the one project Proj, but still no errors.

After I opened all the files in project and called build again, with the files open the syntax error was shown in the errors list, so I fixed it and built successfully.

so the key was, You need to keep the all the files open if you want to see the errors, otherwise it's just "build failed" without any clues ( in .net 6 VS2022).


update: you could look in the output window, you'll see the errors there, even though they may not appear in the error list

buga
  • 852
  • 9
  • 21
1

Visual Studio is not the greatest at displaying Razor -or Blazor-related errors in the Error List view. You should try and build your project and watch the Output view for the actual errors. This will usually tell you the view that is having issues.

Wouter Vanherck
  • 2,070
  • 3
  • 27
  • 41