ILSpy icon indicating copy to clipboard operation
ILSpy copied to clipboard

Issues of ResXResourceWriter

Open CreateAndInject opened this issue 2 years ago • 0 comments

  1. Generate file even if nothing added to
using var reader = new ResourcesFile(s);
using var writer = new ResXResourceWriter("abc.resx");
foreach (var pair in reader)
    writer.AddResource(pair.Key, pair.Value);
// Do something about abc.resx
Debug.Assert(File.Exists("abc.resx")); // Even if foreach is empty

ResXResourceWriter in System.Windows.Forms will generate a file contains only format infomation, and VS will generate such file also.

  1. Add something eg. typeNameConverter like ResXResourceWriter in System.Windows.Forms ILSpy can not generate .NET 2.0 resources, it always generate .NET 4.0 resources.

CreateAndInject avatar Jul 13 '22 18:07 CreateAndInject