This relates to Visual Studio 2017 Community. Most of our build process prefers the VS2015 tools, but has been updated to build under VS2017 tools too.
The diagnostic message provided helpfully by Visual Studio:
Project 'MyProject' is not up to date. Input file '..\codeanalysis\bin\myanalyzer.dll' is modified after output file ''.
Building MyProject on its own exhibits this behaviour, every time. But after forcing a Rebuild of MyProject and letting the rest of the projects sort themselves out, the problem goes away.
Until the next time we update MyAnalyzer, of course.
MSBuild is well aware that nothing has changed. Is there any way to tell this to Visual Studio? I am aware that technically VS is correct here, but I know things it doesn't.
Ultimately it looked like I was indeed doing the wrong thing here. Trying to suppress VS's change detection is incorrect and what I should be doing is forcing MSBuild to rebuild when the analyser changes.
So basically, make MSBuild's change detection behaviour match VS's instead of the other way around.
I accomplished this by adding the analyser assemblies as hidden, dummy content items to each project, so my common ItemGroup now looks like:
<ItemGroup>
<Analyzer Include="@(AnalyzerAssemblies)" />
<Content Include="@(AnalyzerAssemblies)">
<Private>False</Private>
<Visible>False</Visible>
</Content>
</ItemGroup>
This appears to have the desired result, causing MSBuild to consider the analyser timestamp when VS invokes it, which makes the entire solution rebuild once and then settle down.