-
|
What is expected relation between content of automatically generated source files and user display language used in build?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
Content can not depend on user display language. Automatically generated source files should be consistent and reproducible across different machines and environments, regardless of the user’s display language. If generated content varied based on locale, it would break reproducible builds and could introduce subtle bugs. Comments or metadata that appear to vary with language should be either neutralized or excluded from reproducible outputs. |
Beta Was this translation helpful? Give feedback.
You’re right that MSBuild has historically emitted localized comments into generated source files (including AssemblyInfo.cs), and your example from WriteCodeFragment is accurate. There does not appear to be an explicit statement in MSBuild documentation that forbids localized content in generated source files.
My point is based on documented goals and guidance around reproducible / deterministic builds, rather than a single rule targeting comments specifically.
Some relevant references:
.NET deterministic builds
Microsoft documents that deterministic builds aim to ensure that the same inputs produce the same outputs, byte-for-byte:
https://learn.microsoft.com/dotnet/csharp/language-ref…