Skip to content

WriteCodeFragment task is locale dependent. #13191

Closed

Description

@PetSerAl

string comment = ResourceUtilities.GetResourceString("WriteCodeFragment.Comment");
globalNamespace.Comments.Add(new CodeCommentStatement(comment));

Here WriteCodeFragment task use localized resource string as comment in generated source file. This behavior is at odds with reproducible build. I think that resource string should be replaced with language neutral non-localizible string constant.

Activity

  1. added
    Area: TasksIssues impacting the tasks shipped in Microsoft.Build.Tasks.Core.dll.
    on Feb 3, 2026
  2. baronfel commented on Feb 3, 2026

    @baronfel
    Member

    That's one solution - another might be to allow providing the locale to use to look up the embedded resource string.

    I tend to agree that generated code should be invariant by default, though. @rainersigwald Do we have any guidelines for generated code that we use/reference?

  3. added theissue type on Feb 3, 2026
  4. rainersigwald commented on Feb 3, 2026

    @rainersigwald
    Member

    I'm not aware of any but I agree that it seems like it should be invariant by default.

  5. added a commit that references this issue on Feb 5, 2026
    54d87c5
  6. added a commit that references this issue on Feb 25, 2026
    eca7050
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Area: TasksIssues impacting the tasks shipped in Microsoft.Build.Tasks.Core.dll.

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions