We've been investigating this (and similar) issues for quite some time now and still couldn't figure out why exactly that happens. However recompiling the project almost always fixes the generated files.
Be aware the VS2017 often generates files inside projects even when the project is never built. These tend to be broken until the project actually gets compiled (and the diff-generator is re-run)
Cheers