How to transfer .RESX file when changing .NET Framework

How to transfer .RESX file when changing .NET Framework ...

I changed the .NET Framework from 4.0 to 3.5 (due to the incompatibility we found in the third-party dll) and everything went fine except for some .RESX files. I started fixing them manually, but is there any tool I can use to do this? Or how do you do it?

+4
source share
2 answers

Same as "impr0t" (make global replacement), but usually you will have this problem with RESX files: "Unable to load assembly ... or one of its dependencies. Try to load the program with an invalid structure" and it will indicate what something like this in your RESX file:

<metadata name="icons_20.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>115, 17</value> </metadata> <data name="icons_20.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64"> <value> AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ... ... ... AQEB7wL/BwABeAEBAeAJAAFwAQAB4AkAAWABAAFgCQABQAEAAWALAAEgCwABIDsAASAJAAFAAQABIAkA AUABAAEgCQABYAEAAWAJAAFwAQAB4AkAAXgBAQHgCQABfAEHAeALAAEPAv/3AAs= </value> </data> 

therefore, the fix is ​​described here:

http://connect.microsoft.com/VisualStudio/feedback/details/532584/error-when-compiling-resx-file-seems-related-to-beta2-bug-5252020

from this site:

Bypass

  • Open the form in the designer and make the necessary changes to the graphical interface. Close designer and save
  • Compile the project and get a RESX compilation error (only forms with Imagelist should have this problem)
  • Double-click on the resx compilation error to open the resx file.
  • Go to the beginning of imagestream.
  • Change upper stream line images: AAEAAAD ///// AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w K AAEAAAD ///// AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
  • Close and save the resx file and recompile.

** NOTE: The only difference is the characters at the end of "j00LjAuMC4w" to "j0yLjAuMC4w"

+2
source

Usually I just went through and edited the xml.

.NET 4.0

 <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 

.NET 2.0

 <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 

It won’t take too long if you just find and replace. Everything seems to work just fine when recompiling.

+3
source

Source: https://habr.com/ru/post/1401015/


All Articles