So, (seemingly) out of the blue, my project starts getting compiler warning 1685:
The predefined type \'System.Runtime.CompilerServices.ExtensionAtt
Another solution for this issue => Right click project -> Properties -> Build -> Treat warnings as errors -> None