Can't pull up designers for editing
I clicked on something, I don't know what, and it caused .designer files and .resx files to appear in the Solution Explorer along with the .vb files that were there for 4 of 10 .vb files. For these 4 I can't get the designers to show in the edit pane. A new designer appears when I right-click on the .vb and select "show designer". For the other 6 where there's still just a .vb by itself, I can pull up the designer. What can I do to see those other designers?
Re: Can't pull up designers for editing
Not all .vb files are viewable in designer, some are code only, i.e. modules and classes for instance.
The link to "view designer" is for GUI oriented files, like forms and user controls.
It sounds like you hit the "Show All Files" button above the Solution Explorer.
Re: Can't pull up designers for editing
When I click on "Show All Files" even more stuff appears in the solution explorer. (bin, obj, References)
I have some designers that I need to modify and I can't do that.
Re: Can't pull up designers for editing
I'd like to see a screenshot of your Solution Explorer window. Or, better, can you zip your file (remove the /bin and /obj folders first!)? I'm sure we can figure out what went wrong.
2 Attachment(s)
Re: Can't pull up designers for editing
This is the Solution Explorer. I can't display the designers in edit mode for StockItemsEditPopupForm and all those below it.
Re: Can't pull up designers for editing
This project looks like it's lost its associations between the forms and their designer/resx files. That means it doesn't understand they're related anymore. There's not really a way to fix this without hand-editing the .vbproj file. If you upload that, I could give it a go, but if you look at a working project it's pretty easy to figure out what changes to make.
I don't know how you "clicked something" and got into this state, but it's a good reason to learn how to save yourself from mistakes like this in the future! In order from 'worst' to 'best':
- Periodically make a .zip file out of your project and keep it somewhere safe. Keep at least 3 prior versions.
- Use a product like Dropbox or CrashPlan or even Windows' Shadow Volume copies (which got some friendlier name in Win8) to automatically keep restorable backups.
- Learn to use source control, which is sort of like having both of the above. A good tutorial for Mercurial is at http://hginit.com, but there are many other options like Git and Perforce. Github has limited free project hosting. Microsoft has TFS source control which integrates with Visual Studio, but it costs a lot of money, requires a server, and is generally regarded as less useful than "copying the project to tape drives that are then stored in another state".
Re: Can't pull up designers for editing
Quote:
Originally Posted by
projecttoday
This is the Solution Explorer. I can't display the designers in edit mode for StockItemsEditPopupForm and all those below it.
Déjà vu
Give the procedure described in the answer a try.
Re: Can't pull up designers for editing
Thanks Sitten and TnTin for staying with me on this.
I failed to mention (due to the fact that I thought it had been successful) that I recently changed the name of the project.
I am using VB Express 2010 and Windows 7. When I right-click on the 3 file names I do not get "Exclude from Project".
Where is the .vbproj file?
Re: Can't pull up designers for editing
Quote:
Originally Posted by
projecttoday
Where is the .vbproj file?
It's located in your project folder in this directory.
%SystemDrive%\Users\%USERNAME%\Documents\Visual Studio 2010\Projects
Re: Can't pull up designers for editing
This is the .vbproj file, opened in WordPad
Code:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishUrlHistory>publish\</PublishUrlHistory>
<InstallUrlHistory />
<SupportUrlHistory />
<UpdateUrlHistory />
<BootstrapperUrlHistory />
<ErrorReportUrlHistory />
<FallbackCulture>en-US</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
<ProjectView>ProjectFiles</ProjectView>
</PropertyGroup>
</Project>
Do you think I could create a new project?
Re: Can't pull up designers for editing
Actually, that's only true if you're using default everything. It's quite different on my machine, not only because I've remapped My Documents to a different drive but because I don't tend to save project files in My Documents.
The best way to get at your project file is to remember where you save your stuff, then go look there. If you don't know where your files are, how are you supposed to deploy the result? Or back up the project?
A handy shortcut, if you aren't sure where your project is, is to right-click the project in Solution Explorer and choose "Open Folder in File Explorer".
I'm really not certain what it means if "Exclude File From Project" isn't present. It makes me wonder if you clicked the right thing. "Open Folder in File Explorer" should be there. If it isn't, either you're still not clicking on the right thing, or your Visual Studio has a voodoo curse and you should reinstall everything.
Re: Can't pull up designers for editing
Quote:
Originally Posted by
Sitten Spynne
Actually, that's only true if you're using default everything. It's quite different on my machine, not only because I've remapped My Documents to a different drive but because I don't tend to save project files in My Documents.
People like you don't ask that question and everyone who does ask that question uses the default location otherwise they would have known the location because they picked it in the first place.
Re: Can't pull up designers for editing
I don't know what you mean by default everything. The project is saved at My Documents/Visual Studio 2010/New Projects as are several backups. I copied the .vbproj file into My Documents root before I opened it in WordPad to display here. The oldest backup of the project under the current name has the problem. The newest backup of the project under the old name does not have the problem.
As I said earlier, a month or two ago I changed the name of the project, I don't remember how exactly, after googling and finding several methods. I'm pretty sure I made some changes to some of the modules after this change, possibly to the ones that I'm having the problem with.
Re: Can't pull up designers for editing
Quote:
Originally Posted by
projecttoday
As I said earlier, a month or two ago I changed the name of the project, I don't remember how exactly, after googling and finding several methods. I'm pretty sure I made some changes to some of the modules after this change, possibly to the ones that I'm having the problem with.
Have you tried changing the name back to what it was originally it's possible the method you used for changing the name was the problem.
Re: Can't pull up designers for editing
That .vbproj file in #10 references no files at all. There's nothing I can do to fix it, because it's an empty project. That can't be your actual .vbproj file, try following the instructions in #11 to have Visual Studio take you to the file.
Quote:
People like you don't ask that question and everyone who does ask that question uses the default location otherwise they would have known the location because they picked it in the first place.
People like that benefit greatly from learning it's a question worth asking, and how to get VS to give them the answer when they forget themselves.
Re: Can't pull up designers for editing
Quote:
Originally Posted by
projecttoday
I am using VB Express 2010 and Windows 7. When I right-click on the 3 file names I do not get "Exclude from Project".
Unfortunately, that option is not available in VB Express 2010.
If the few lines that you showed in post #10 are all that is in the project file, then it is toast. Your best bet is to create a new project and then add all the existing files via: Project Menu->Add Existing Item.
Re: Can't pull up designers for editing
Very strange. There are even fewer lines in the one that works.
This is the actual project file from the project that doesn't work:
Code:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishUrlHistory>publish\</PublishUrlHistory>
<InstallUrlHistory />
<SupportUrlHistory />
<UpdateUrlHistory />
<BootstrapperUrlHistory />
<ErrorReportUrlHistory />
<FallbackCulture>en-US</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
<ProjectView>ProjectFiles</ProjectView>
</PropertyGroup>
</Project>
This is the actual project file from the project that works:
Code:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ProjectFiles</ProjectView>
</PropertyGroup>
</Project>
Re: Can't pull up designers for editing
Oh crud, I thought I'd seen him mention VS 2010, but missed it when I double checked. It's *not quite* accurate that it's "not present". It's just "not present as ubiquitously." But we're dealing with Express Edition, so they might have even hid the one place where I know it is. We're still not out of ammunition.
In Pro, if you right-click the /project/ and not a random /file/, I have the "Open Folder in Windows Explorer" option. Also, if I open any file, and right-click the /tab/ over the text editor, I have an option for "Open Containing Folder" that works. Maybe they took that away in Express Edition. Can't have people understanding concepts like "the file system", can we?
Nonetheless, this ought to be sure-fire even in Express Edition. Open the Properties Window, should be View>Properties, but at the same time I can't fathom why a WinForms programmer wouldn't already have it open. Click on the project in Solution Explorer. There should be two properties displayed: "Project File" is just the name of the project file. "Project Folder" is the folder where that is located.