Skip to content

Replace strings with resources in Mono corelib #34056

@danmoseley

Description

@danmoseley

In src\mono\netcore\System.Private.CoreLib the pattern Exception\s\(" has 340 hits. All these strings should instead come from src\libraries\System.Private.CoreLib\src\Resources\Strings.resx somewhere. In most cases there are already equivalent strings that can be determined by brief inspection of equivalent code in src\coreclr\src\System.Private.CoreLib or possibly src\libraries\System.Private.CoreLib.

Sometimes the strings need adjustment eg throw new ArgumentException ("type is not TypeBuilder but " + type.GetType (), "type"); vs throw new ArgumentException(SR.Argument_MustBeTypeBuilder);.

Some strings are in native code in coreclr eg throw new SynchronizationLockException ("Object is not synchronized"); is not thrown in Monitor.cs in coreclr. In this case it can just be throw new SynchronizationLockException()

A (very?) few may need new strings.

There are also a few trivial cases where the string should be replaced with nameof eg throw new ArgumentException("className") -> throw new ArgumentException(nameof(className))

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueIssue should be easy to implement, good for first-time contributorshelp wanted[up-for-grabs] Good issue for external contributors

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions