We should move the target path calculation from MSBuild into the source generator always. We have the project file passed in, so the calculation is trivial to do in the generator directly.
My suspicion for why it was done like this is that the old pre-SG way of compiling had logic in MSBuild for target path calculation, and the authors didn't want to have a duplicate that could get out of sync.
Originally posted by @chsienki in #12355 (comment)