[Bug]Generating project files breaks build

I would replace the ToUpper or ToLower calls to their Invariant versions: String.ToUpperInvariant Method (System) | Microsoft Docs

Similar things can happen to Equals.