Skip to content

Duplicated members on generated string resources class #493

Description

@chrisbewz

Describe the Bug

When declaring resources with same base name but different on suffix although the static string member generated, an extra partial class declaration is produced with same name, raising CS0102 error.

For example, the following declaration on resx file:

Image

Produces:

  • A static property accessible calling Strings.MSG.InstallationFailed (static property)
  • A nested partial class called InstallationFailed accessible calling Strings.MSG.InstallationFailed (static partial class)

This fires the CS012 compiler error since both declarations share the same base name.

Steps to Reproduce

  1. Create a Strings.resx file on project
  2. Create a resource with a common name SomeResource
  3. Create another resource with same base name and an extra suffix SomeResource_Alt

Back this issue
Back this issue

Activity

  1. kzu commented on Aug 27, 2026

    @kzu
    Member

    This is by design. You cannot use a resource name as the base name for another. You should rename SomeResource to SomeResource_Title to be able to use SomeResource_Alt

  2. locked and limited conversation to collaborators on Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions