Visual Studio error opening form file, help tracing location
-
I am working with Visual Studio 2005 w/ Service Pack 1 for Vista I experienced a crash in Vista last night while "playing" my app. As it was the end of the day, I did not log back in and went home. I came back in today, opened my solution and now am greeted by a friendly message from Visual Studio when I attempt to open the form [design] telling me that "The file cannot be opened with the selected editor. Please choose another editor. " If I build the project, I get an error saying "String cannot have zero length" The file specified is "LC" (which is not the name of anything I have in my solution.). No line number is listed, nor column. I am able to open the code for the form, the form designer, and a separate form in my solution. I've Googled the error and so far found nothing that is of any help. I am hoping that the good people of Code Project have seen this before and might know of how I can track down what is causing the problem or a fix. Thanks in advanced! -Steve
-
I am working with Visual Studio 2005 w/ Service Pack 1 for Vista I experienced a crash in Vista last night while "playing" my app. As it was the end of the day, I did not log back in and went home. I came back in today, opened my solution and now am greeted by a friendly message from Visual Studio when I attempt to open the form [design] telling me that "The file cannot be opened with the selected editor. Please choose another editor. " If I build the project, I get an error saying "String cannot have zero length" The file specified is "LC" (which is not the name of anything I have in my solution.). No line number is listed, nor column. I am able to open the code for the form, the form designer, and a separate form in my solution. I've Googled the error and so far found nothing that is of any help. I am hoping that the good people of Code Project have seen this before and might know of how I can track down what is causing the problem or a fix. Thanks in advanced! -Steve
I don't use Vista, and haven't seen that problem under XP yet either. The first thing I'd try would be to close the Solution, go into the Projects folder and delete the .SUO file (which is normally hiddden). Then try reopening the project. After that, I would suspect that one of the files for that form has been corrupted somehow. I'd probably try salvaging the code for the form by opening its .vb file in Notepad and copying it to another file, then delete the form from the project, making sure the .vb, .resx, and .designer.vb files are removed, then recreate then form with all the controls using the same names you used before. You can copy and paste the code you salvaged back into the form's code.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
I don't use Vista, and haven't seen that problem under XP yet either. The first thing I'd try would be to close the Solution, go into the Projects folder and delete the .SUO file (which is normally hiddden). Then try reopening the project. After that, I would suspect that one of the files for that form has been corrupted somehow. I'd probably try salvaging the code for the form by opening its .vb file in Notepad and copying it to another file, then delete the form from the project, making sure the .vb, .resx, and .designer.vb files are removed, then recreate then form with all the controls using the same names you used before. You can copy and paste the code you salvaged back into the form's code.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007Thanks for the suggestion Dave. Deleting the SUO file did not fix it, but like a cautious VS user, I had a backup from a couple days ago I restored and updated with the notepad opened VB files. Still wish I could track down what went wrong for the time I don't have a backup or for other users.