Search code examples
c#.netxmlresx

Difference between (ResourceWriter & ResXResourceWriter) and (ResourceReader & ResXResourceReader) in C#


I wanted to create an XML File from Resouce File(.resx).

I succeeded in that by using ResXResourceReader class. But then I came to know that there exist another class for this purpose ResourceReader.

Then what is the difference between them? and which one should be used for this purpose.

Same case with ResourceWriter and ResXResourceWriter. What difference do they have between them?


Solution

  • ResourceReader reads binary and ResXResourceReader reads XML.

    ResourceReader MSDN:

    Enumerates the resources in a binary resources (.resources) file by reading sequential resource name/value pairs.

    ResXResourceReader MSDN:

    Enumerates XML resource (.resx) files and streams, and reads the sequential resource name and value pairs.

    More information can be found here.