Hello,
I have a strange problem that I have looked for the answer to but no solution has seemed to work yet. I am using Visual Studio 2005 with Visual source safe, and I have a visual basic solution I am working with. For one of the .vb files in my soution (parser.vb), visual studio for some reason stopped opening the file. Yesterday everything was working fine like normal, but now, when I double click the file from the solution explorer, it will open the file in what looks like a hex editor in a new tab (this is all still within the visual studio IDE, it doesnt pop open a separate application or anything). All the other files in the solution still open normally with the vb code editor with intellisense and all of that. Now, if i right click parser.vb and click "view code", I get the following error
"There is no available editor for '<path>\parser.vb'. Make sure the application for the file type (.vb) is installed."
Also, everywhere else in my solution that referenced parser.vb now has the error "Type 'parser' is not defined". Furthermore, in the Error List there is "Error 4 Unable to open module file <path>\parser.vb': System Error &H80041feb&"
I can solve this problem by deleting the file from the solution, and re-adding a new one with the same name/same code. And if I copy and paste all of the hex code it displays into a new .vb file, the IDE displays the code normally as it should be. But I'd like to know a better way to fix this, or why its happening in the first place, it seems like a strange bug, and it has happened before on a different machine and different visual studio 2005 install. I am doing nothing out of the ordinary with parser.vb, and have opened the file in notepad to check it, and all the code is there as it should be, so why does visual studio open it in a hex view, or not open it at all Like I said, everything was fine yesterday, today I came and opened the solution, and this was the case.
Thanks

cant open .VB file in visual studio editor,opens in hex view bug?
ssmorgan
I solved the problem. For my project, I needed to parse a text file and do various things with it, I have some code to check if the line is valid, so one of the checks I perform using the following code:
v_recordline.Contains("")
But for whatever reason, Visual Studio will allow you to enter the "" character, and the code runs just fine, but after you close the .vb file and try to edit it again, it opens in a hex edit mode and will not open it in the normal vb code editor. It is also no longer recognized as a class anywhere else in the project. Furthermore, when you click "view code" on the file, this is when you get the "There is no available editor for '<path>\parser.vb'. Make sure the application for the file type (.vb) is installed." error.
So if I remove the "" character and change the line of code to be v_recordline.Contains(""), the .vb file opens as normal.
Now I dont know if this is a bug or not, but it stands to reason that the Visual Studio editor should be able to open the file normally, as notepad and editplus and slickedit all had no problems. The ascii code for the character is the following:
System.Text.Encoding.ASCII.GetBytes("")
{Length=1}
(0): 26
iansbrainstorm
Shall I Count the Ways
1. There is the notorious compatability issue with sql server 2005 and UAC which means that you can't do a clean install. Sure there is a work around. But that alone means that the Vista / VS 2005 combination is not ready for prime time. But that means wasted time and effort tracking down the fix and figuring out what to do.
2. There is the miserable waiting while the screen adjusts to any operation when in a data set designer. Well documented and apparently NOT fixed in SP1 Beta.
Hmmmm ...
3. The inability of MS support personnel to develop a code snippet for me because MS doesn't yet support development for xyzzy for Vista. (xyzzy is an MS product featured in Vista, but shall rename nameless because I don't need to talk about what I'm up to.)
This just adds to the frustrations that I have with VSTS 2005 on another project where ClickOnce distribution is NOT supported until Orcas for certain combinations of ingredients. A problem known to MS for over a year.
Luckily I have a second PC that I can check this stuff out on and continue to do what MS seems to continue to recommend - develop for Vista on XP. That's tough for me since xyzzy only exists on Vista!
So at any rate, now that I've vented what is the fix
Regards,
Al Christoph
GunasekaranT
I don't know if I'm comforted to find my exact problem online or disturbed to realize it was posted over six months ago.
I cannot open a .vb file in visual studio, and I too am running Vista and VS 2005.
It was suggested that the line v_recordline.Contains("") be changed to v_recordline.Contains(Asc(26))) to stop the .vb file from opening in hex.
How does one open the file in a readable format to make said change When I try to open the file in notepad, it is in hex.
Thanks.
Predator14567
There is definately something wierd here, out of interest were you using SP1 Beta as well
I am running the SP1 beta and I just got this issue to, the offending line was:
Public EncryptKey As String = "7Q D ! "
This seemed to work fine in a Form Class but I moved it to a module and since then the module keeps coming up with that error.
If I remove it it seems fine.
Microsoft any ideas
Regards,
Michael Proctor
daijun
I just had a VISTA crash - yeah I know VSTS 2005 is barely supported on Vista - and when i fired up the IDE again I got the subject error for my dataset.vb file.
UGH!
Here is the white screen of death:
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
at Microsoft.VisualStudio.NativeMethods.ThrowOnFailure(Int32 hr, Int32[] expectedHRFailure)
at Microsoft.VisualStudio.Shell.Design.Serialization.DocData.CreateNativeDocData(IServiceProvider provider, String fileName)
at Microsoft.VisualStudio.Shell.Design.Serialization.DesignerDocDataService.GetFileDocData(String fileName, FileAccess access, String createTemplate, Boolean nestedItem)
at Microsoft.VisualStudio.Shell.Design.Serialization.DesignerDocDataService.GetChildDocData(String name, FileAccess access, String createTemplate)
at Microsoft.VSDesigner.DataSource.ProjectDataSourceDescriptor.EnsureChildren()
at Microsoft.VSDesigner.DataSource.ProjectDataSourceDescriptor.Init(IServiceProvider provider, IVsHierarchy primaryHierarchy, UInt32 primaryItemId, Object primaryDocDataObject, UInt32 docCookie, IVsInvisibleEditor invisibleEditor, IDesignerHost host)
at Microsoft.VSDesigner.DataSource.ProjectDataSourceStorage.EnsureInvisibleEditor(ProjectItem dsProjectItem, Boolean ensureWritable, Boolean createInvisibleEditor)
at Microsoft.VSDesigner.DataSource.ProjectDataSourceStorage.GetDataSourceInternal(Object caller, ProjectItem dsProjectItem, Boolean ensureWritable, Boolean createInvisibleEditor)
at Microsoft.VSDesigner.DataSource.Designer.DataSourceDesignerLoader.HandleLoad(IDesignerSerializationManager serializationManager)
zensunni
Daniel_laksjdhfg
Thank you for your comment. We have looked into this and believe this behavior is by design. The correct way for you to write the code is
v_recordline.Contains(CStr(Asc(26)))
Ting Liang
XNA Rockstar
"yeah I know VSTS 2005 is barely supported on Vista - and when i fired up the IDE again I got the subject error for my dataset.vb file."
What do you mean by this