Link to home
Start Free TrialLog in
Avatar of dcmorrell
dcmorrell

asked on

vb class file sudden filled with garbled nonsense. All the code is now missing!

I don't know what the deal is. I had been working in this class file for the better part of a day, I close out of it, open it back up and now all the code is gone and in its place is this [see attached].

Can anybody tell me where my code went?!
wtf.png
Avatar of viralypatel
viralypatel
Flag of India image

Goto File->open

Browse to the file in the open dialogue.

After selecting the file do not click on the open button directly. Click on the drop down in the open button and say "Open with..."


Select an appropriate editor for vb file to display the actual code.
ASKER CERTIFIED SOLUTION
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Something changed the default behavior for the opening of .vb files and set it to open in the Binary Editor.

Simply right-click on the file in the Solution Explorer, select "Open With", then the Microsoft Visual Basic Editor, and click on the Set as Default button before going OK.
@JamesBurger - A VB file when opened in notepad looks nothing like this file, one would see the code for example.
@AndyAinscow.

Where did I talk of Notepad?

It is clear that the file is opened in the Binary Editor that is provided with Visual Studio. It is exactly the same disposition, and the tab and colors at the top are straight from VS.
@JamesBurger
Look at the contents shown in the question - that is not a VB file, one one can easily verfiy by opening any vb file in notepad.
You're right Andy. I did not look at the content, only at the format.

I did a little search, and it seems to be one of the .cache files generated by the compiler in the obj folder.

@dcmorrell
I hope you have a recent backup. Your file is gone.
:-)  (I thought you might have not looked closely enough)

Glad you agree with my earlier comment #37143963
Avatar of dcmorrell
dcmorrell

ASKER

So I opened the file with the "open with" designation and made sure that VS treated the file as code. upon opening it, I see about half of my original document, but it just cuts off half way and is filled with a completely other, alien group of functions I have never seen. The file is destroyed, so random. There goes hours upon hours of work. Thanks VS! But honestly thank all of you for your answers.
Hmmm - did you read the comments closely.  My first comment (earlier than the one you accepted) told you that you have a corrupted file.
@dcmorrell

Andy is right, he should have the points. You should reopen the question and transfer the points to him.

And do yourself a favor in the future: a backup every day.
@James - thankyou.  
how do you do that?