79344982

Date: 2025-01-10 08:12:04
Score: 2
Natty:
Report link

I am having a similar problem. I have found a way to fix my problem but it involves some manual changes to the RESX file. Try doing a global search of your entire solution for the item name you added to resources.

When I add resources in this new editor, I add them to RESOURCEs in the options panel as you showed above. I then had to manually change the RESX file.

  <data name="Shopping" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>My Project\Resources\Shopping.txt;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>

Note the start of the clause. I added '..\' (dot dot backslash) ahead of the 'My Project' part of that. I presume that changed the reference to relative.

I had a further problem you can also see in the line. My addition was generated as a .Byte[] array even though I specified it as a Text File. All of my old references were generated as System.String. I had to change this in the RESX file entries. This is definitely a change from the old editor and it is very confusing.

My initial problem was very much like what you described. When I tried to access my added resource using My.Resources("xxxxx"), it did not work until I got the file moved into proper location. I did a lot of things to get this resolved. So many that I am not sure which one actually did the trick. I believe I did it using a drag/drop or a copy/paste in solution explorer.

Then I had the problem with it being added as a byte array. I adapted by programmatically changing the byte array to a string when I read it, then I figured out how to modify the definitions in the RESX file to be string.

  <data name="BaseDropCategories" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\BaseDropCategories.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>

and

        Friend ReadOnly Property BaseDropCategories() As String
        Get
            Return ResourceManager.GetString("BaseDropCategories", resourceCulture)
        End Get
    End Property

I had enough old references in my RESX file to refer to to get the entry right. (Be careful modifying your RESX file!!)

I am still processing what I've done and I experimented on another program that has no resources without success. I still would like to know WHY things now work the way they do, but I suspect some of what I did you may find usable. My additions in this program show up in the grid in the MS Resource Editor screen but are inaccessible in the only way I know at present to access it in code.

Reasons:
  • Blacklisted phrase (1): I am having a similar problem
  • Blacklisted phrase (1): did not work
  • Whitelisted phrase (-2): I figured out
  • Long answer (-1):
  • Has code block (-0.5):
  • Me too answer (2.5): I am having a similar problem
  • Low reputation (1):
Posted by: E Bell