Bug? [Major Bug] - Restarting PC corrupts ALL project files AND the "layoutV0.2" XML file!

LWGShane

Well-Known Member
Licensed User
Longtime User
I restarted my PC after experiencing some DNS issues and I re-opened my project only to be presented with the following error message:

"Error loading file. The given key was not present in the dictionary".

Upon inspecting my project file with a text editor, the only thing it contains are "NULL" blocks. So I tried to save my other modules and they contain the same freaking thing. So after that I decided to save my layout files.. Nope..... The same freaking thing as the code modules and project file: Nothing but "NULL" blocks meaning hours of work lost because of a "feature" unique to B4X. (No other IDE that I've used overwrites every damn file with "NULL" blocks upon a system restart.)
 

moster67

Expert
Licensed User
Longtime User
Sorry to hear that but I hope for you that you have made (and make) backups of your important projects. You can loose projects also if your Harddrive (independent of IDE) decides to break down in the wrong moment......
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
The IDE doesn't keep the files open. You can kill the IDE with a task manager and it will not affect the loaded project.

Were you asked to save the project when you restarted your computer?
Are you using a VM?

My guess is that the IDE wrote the files and then the computer turned off and the files got corrupted for some reason. This normally doesn't happen (never happened here where all 4 IDEs are always open and the computer is restarted from time to time).
The IDE writes the files atomically. Only when all the data is ready it writes each file with a single call to .Net File.WriteAllBytes method.

I will add a short delay when the IDE is closed. Maybe it will help in such cases.
 
Last edited:
Top