4

Almost every piece of .NET work I've done has involved a .sln with multiple .csprojs, with a tree of dependencies between the projects.

When I try to rebuild the whole .sln, then and one of the early projects has a compiler error, then I get that compiler error, plus a whole heap of errors complaining that later projects can't compile because they can't find the earlier project's compiled dll. Well, no shit!

The specific error is:

Severity    Code    Description Project File    Line    Suppression State   Error
CS0006  Metadata file 'C:\Work\ADH\ADH\MyParentProject.dll' could not be found  MyChildProject  C:\Work\ADH\ADH\MyChildProject\CSC  1   Active

I believe I could entirely suppress this error message, but I imagine there are scenarios in which that message occurs that AREN'T just "compilation visibly failed for an earlier project".

Is there some way to specifically suppress the error in that case (e.g. a setting for "if a project fails to compile, don't attempt to compile child projects / don't show their error messages / don't show THIS message, if the parent failed to compile"?

Brondahl
  • 7,402
  • 5
  • 45
  • 74
  • I found a similar SO post (https://stackoverflow.com/questions/31449330/stop-solution-build-on-first-compilation-link-error-msbuild) and a couple potentially helpful MS extensions: StopOnFirstBuildError and VSColorOutput. – Mitch Stewart May 30 '19 at 16:44
  • Possible duplicate of [stop solution build on first compilation\link error - msbuild](https://stackoverflow.com/questions/31449330/stop-solution-build-on-first-compilation-link-error-msbuild) – Brondahl May 31 '19 at 06:54
  • I don't think you can suppress the error in the "normal" way - I've tried adding a setting to the solution's .editorconfig, but it appears to be ignored. – Loophole Aug 06 '21 at 05:36

0 Answers0