The regular expression used in CodeGenVM.InjectAnalysisAttributes to check for existing [Dimension] or [Measure] attributes is too strict. It requires the attribute to be immediately above the property. If there are other attributes (like [Required]) or comments in between, it fails to detect the existing attribute and injects duplicates, causing compiler errors. The fix replaces the regex with a robust string block search.