This was a regression from93d7ec8836(#38110). Mono's old implementation of Microsoft.Build hardcodes HasUnsavedChanges to always return true. This workaround can be reverted once we switch to official Microsoft.Build. (cherry picked from commit81f13f6171)