I just had something really odd happen. I started writing a little tool targeting .NET 5 in VS2019. I put a handful of controls on a form, changed a few properties, added a few event handlers...then went outside and worked on some sprinkler valves, which probably isn't related.
When I got back, I wrote some of the backing code, and went to populate a listbox only to find that my form had been totally erased. All the controls were gone, the form title had reverted to Form1, and so on. All the Handles clauses had been removed from the control event handlers, as well.
I've never seen this happen. The project wasn't closed and reopened, I had left it open. It had been saved several times after various changes had been made, so it wasn't new in that sense either. The form was there, it had just been reset to empty, and I'm not quite sure when.
There were only a couple things I did that seem like they could have triggered a reset like that, but neither one should have done so: I changed the target from AnyCPU to x86, and I tried adding, then removing, some settings. Something was going wrong with the settings, because I got error messages when I added the settings file, which was fixed by restarting VS, but I got more error messages when I added the second setting, and errors when I removed them. I don't remember much about those messages, aside from them saying something about an error creating the XML file, or something like that, but since I decided that I didn't need the settings, I didn't pay a whole lot of attention to them.
Changing the CPU target should have no impact. I've done that plenty of times.
Has anybody seen that happen, or can anybody explain what could have happened?
When I got back, I wrote some of the backing code, and went to populate a listbox only to find that my form had been totally erased. All the controls were gone, the form title had reverted to Form1, and so on. All the Handles clauses had been removed from the control event handlers, as well.
I've never seen this happen. The project wasn't closed and reopened, I had left it open. It had been saved several times after various changes had been made, so it wasn't new in that sense either. The form was there, it had just been reset to empty, and I'm not quite sure when.
There were only a couple things I did that seem like they could have triggered a reset like that, but neither one should have done so: I changed the target from AnyCPU to x86, and I tried adding, then removing, some settings. Something was going wrong with the settings, because I got error messages when I added the settings file, which was fixed by restarting VS, but I got more error messages when I added the second setting, and errors when I removed them. I don't remember much about those messages, aside from them saying something about an error creating the XML file, or something like that, but since I decided that I didn't need the settings, I didn't pay a whole lot of attention to them.
Changing the CPU target should have no impact. I've done that plenty of times.
Has anybody seen that happen, or can anybody explain what could have happened?