Unable to open VB WinForms files in designer mode.

G

Guest

Suddenly I find myself unable to open Winforms files in designer mode. I get
the message quoted below. I can open other types of vb files like modules,
classes and code behind files, but simply creating a new project and double
clicking on Form1.vb gets me this message:

<<<
There is no editor available for
'C:\....\Form1.vb'.
Make sure the application for the file type (.vb) is installed.
I am using Vista x64 and Visual Studio 2005. A repair of the installation
and reinstallation of SP1 and the Vista updated did not help. Any ideas?
 
M

Matt F

From the message, it looks like the file association got screwed up somehow.
If you attempt to just open the .vb file directly does it launch visual
studio?

If that does prove to the the issue, I can't be much help with regards to
where/how to set file associations in Vista though. Don't have it installed
and the very limited experience I do have with it leads me to beleive it's
probably no where close to how it was handled before.
 
G

Guest

Thanks Matt,

Yes, the associations work fine. Any .vb file will launch Visual Studio. It
seems to be a Visual Studio issue in that other .vb files are opened and
edited fine by VS including classes and modules and even Form1.Designer.vb.
It is just the file that invokes the visual designer, Form1.vb that won't
open.
 
C

Chris Dunaway

Thanks Matt,

Yes, the associations work fine. Any .vb file will launch Visual Studio. It
seems to be a Visual Studio issue in that other .vb files are opened and
edited fine by VS including classes and modules and even Form1.Designer.vb.
It is just the file that invokes the visual designer, Form1.vb that won't
open.

What happens if you add a brand new empty form to the project? Can
that one be opened in the designer?

Chris
 
G

Guest

No, unfortunately creating a new form or creating a new project with only a
new form results in the same behavior. Opening a working project like a quick
start from the MS Enterprise Library also has the same behavior. Oddly, I
have one old test project with a single form and one button that opens and I
have no idea why. I found it just now. When I open third pary sample projects
or new projects I create myself I can not view any forms (tried maybe 8 3rd
party and 4 of my own).

I've been working for weeks exclusively in aspx, ascx, and non-UI code and
had not noticed this so I don't know when it started. I wanted to make a
simple WinForms app to test some code and I noticed this.

I am a little worried that Vista x64 compatibility has finally done me in as
I have also had a lot of crash issues with Office 2007 on x64. I have no
issues with eitther on my x86 machine. I was just hoping someone would point
out something simple I have missed. Both machines built basically at the same
time with the same disks.

I am torn between rebuilding this (my primary machine) back to Vista x86 for
days of lost productivity or uninstall and reinstall all my development tools
for a day. I hope I am wrong about x64, but I don't have a warm feeling.
 
M

Matt F

Can you post the code that is in the Form1.Designer.vb file? Since you do
have a seperate project that will open, I'm guessing the issue is somewhere
in the designer code.

Out of curiosity I have a question about the simple project that does open
properly. Was is possibly created in VS2003 and then converted to 2005?
The reason I ask is 2005 has the ability to split classes accross multiple
files and 2003 didn't - therefor there wasn't a *.designer.vb file.
 
G

Guest

You know what, I think you are on the right track actually.

<<can you post the code that is in the Form1.Designer.vb >>

Public Class Form1

End Class

(Note the complete absence of any designer code at all in the file. It was
created as if it was a normal empty class file. I also now note there is no
Form1.resx file out there either. This seems on the right track, but I don't
understand why I get the same message trying to open forms in other working
sample projects.)

<<Was is possibly created in VS2003 >>

No, it was created about a month ago on the same system. It is the only file
in the project and has one button on the form. It has all the normal stuff in
the code behind file.

** It looks like my system was made worse by my repair attempt. In getting
ready to answer your question, I now see that all the templates are gone in
the 'Add Item' dialog. I now can not even add a new form in a project. Same
behavior for C# projects. Oddly, you still have the choices in the popup menu
for class and module, but if you pick those, they don't know what to do
because the item templates are missing.

These too things must be related, I was at least able to add a form BEFORE I
did the repair, it was just defective and apparently empty. After the repair,
I can now not even add a form. Neither explains inability to open forms in
sample projects.

It looks like I am headed for a re-install. It is an agonizing choice on
whether to rebuild the whole machine and abandon x64. That would at least get
me working in Robotics toolkit again. For now I have to switch to the 32 bit
machine to do that because the XNA toolkit is not x64 compatible.

I will google some more now focusing on the templates getting all FUBAR. I
hate the idea of a rebuild or reinstall.

Thanks for your help, that got me on the right track.
 
G

Guest

Yes, just to confirm. All the default templates were completely missing from
where they are supposed to be in the VS installation directory. For all
languages. That could not have been the original problem, because I would not
have been able to add forms.

I copied all the templates from a working installation and they now appear
in the IDE. I can create a form and it has the proper code file. But I can
still not open the designer. This is the code file:

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Form2
Inherits System.Windows.Forms.Form

'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub

'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
components = New System.ComponentModel.Container
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.Text = "Form2"
End Sub
End Class
 
M

Matt F

One suggestion before the whole painful process of a reinstall...

Check on the actual template files themselves ---- maybe the directory isn't
pointed right? Click "tools" then "options" --- in the tree, go to:
"projects and solutions | general" --- this will tell you where your
template files are located...

In my case it's:
C:\Documents and Settings\[USER NAME]\My Documents\Visual Studio
2005\Templates\ProjectTemplates
 
M

Matt F

Your template code is identical to a new form2.designer on my machine ----
character for character ---- so it's not a problem with the template.

I really don't know what to say at this point.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top