0

In my visual studio (2015) project, I've hit a little snag: the Resx file keeps putting references to nonexistent things. The question was asked previously here, and the solution worked (mostly), but the issue keeps coming back every time I make a change in the afflicted form's designer (adding, removing, moving, property changing, etc.).

In my case, the type that's having issues is Vector2, a simple vectors struct I turned into a dll for my other projects a few months back. It was all fine and well, referencing the dll and using it that way, but I found I needed to make a change to it, so I decided to remove the reference to the dll and just copy the Vector2 dll code into my project and change it that way.

Well, I'm not quite sure Visual Studio knows what happened, as it still seems to want to reference some nonexistent something (the invalid Resx issue linked above).

However, in my case the issue is in two places, the auto-generated Resx file for one of my forms:

<data name="VelocityPicker.Value" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
    AAEAAAD/////AQAAAAAAAAAMAgAAAD5QaHlzU2ltLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1
    dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbAUBAAAAD1BoeXNTaW0uVmVjdG9yMgIAAAABWAFZAAAGBgIA
    AAAAAAAAAAAAAAAAAAAAAAAACw==
</value>
</data>

and the auto-generated initialization in the form's *.Designer.cs:

// 
// VelocityPicker
// 
this.VelocityPicker.Location = new System.Drawing.Point(243, 197);
this.VelocityPicker.Name = "VelocityPicker";
this.VelocityPicker.ReadOnly = false;
this.VelocityPicker.Size = new System.Drawing.Size(225, 140);
this.VelocityPicker.TabIndex = 35;
this.VelocityPicker.Value = ((PhysSim.Vector2)(resources.GetObject("VelocityPicker.Value")));

And I'm not quite sure why it's having a problem with the VelocityPicker in particular (though it's also having the exact same problem with another VelocityPicker instance in that form called ForcesReadout), as Vector2 was used extensively elsewhere in my project.

Community
  • 1
  • 1
Cruz Jean
  • 59
  • 1
  • 2
  • 7

1 Answers1

1

After fiddling around with the project files, I found that adding the reference to the original dll back, migrating the afflicted structs to a different file, removing the reference, and deleting and regenerating the afflicted Resx file (via moving a control on that form's designer) finally fixed the problem. Pretty roundabout, but it worked.

I also made a few changes to the Vector2 struct, which I assume played a part in the solution (perhaps versioning conflict).

Cruz Jean
  • 59
  • 1
  • 2
  • 7
  • Thank you for sharing your solution! I was getting a similar error with my resx file, and while I'm not sure what the exact cause was, I tried deleting and regenerating the resx file like you mentioned, and that fixed it! – inejwstine Apr 14 '22 at 20:20