简体   繁体   中英

Using resxresourcewriter to write to an older version of .Net

According to this article : https://msdn.microsoft.com/en-us/library/dd384266(v=vs.110).aspx

It's possible to write a resource file using an older version of .Net, does anyone have any example of how this can be achieved? I found one similar question here but it wasn't answered.

Thanks!

I (sort of) have the answer!

using (var rw = new ResXResourceWriter(FileName, (type) =>
{
    return "System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
}))

This allows you to write the resource and sets the .net version at whatever you specify. This does however have an issue in that the header (reader or writer) is being set explicitly and causing the headers to be invalid.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM