After having fiddled a bit with branches, which most likely ended-up removing a commit that fixed the problem (because I already fixed it a while ago), I ran into the following error while building my project in AzureDevops
With a web project 'YYY', that has a reference on a class library project 'XXX', building in my dev environment worked like a charm, like all software should.
Now when I was building the same project in AzureDevops in order to deploy it in the préproduction environment, the build failed with a good lot of errors that looked a bit like this:
[...] Error CS0246: The type or namespace name 'XXX' could not be found (are you missing a using directive or an assembly reference?)
But it was only a trick, meant to make me waste time ! The build was, indeed, failing because roslyn could not find a DLL, but what was at the root of this problem was actually the fact that the 'XXX' project had no configuration setup for the preproduction environement ! This was being told to me through a single line of yellow warning lost in the middle of other yellow warnings and a mass of PLEASE-LOOK-AT-ME-RED errors so I overlooked it for, hum, "quite some time".
Here it is:
##[warning][...] Warning : The OutputPath property is not set for project 'XXX'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Preprod' Platform='***'. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project.
Now it makes sense ! By not giving this project a Configuration for my curently targeted environment, its build (almost) silently failed and so no DLLs were generated, leading to the unhelpful errors about, well, missing namespaces.
The fix is simple: Open the "Configuration Manager", and give the 'XXX' project a 'preprod' configuration (or whatever name you use for the environment you are currently targeting).
And VOILA ! Commit, Push, Build, and now i'm going home.