I have a resource file named Test.resx and I am trying to add Name&Value to the resource file dynamically using C# code like below and my code works fine but when I try to open the file or read the file it says the below error.
Error: Value does not fall within the expected range
my c# Code,
//path: .../Test.resx
var path = Path.Combine(_env.ContentRootPath, PlatformServiceConstants.FieldResources + "Test"+ PlatformServiceConstants.ResourcesExtensions);
ResourceWriter resourceWriter = new ResourceWriter(path);
resourceWriter.AddResource("Name", "Name");
resourceWriter.AddResource("Age", "Alter");
resourceWriter.Close();
Is there any error in the code or approach? Where I did go wrong?.