.vbp could not be loaded and NOT in notepad neither - vb6

As of yesterday, my vbp file refuses to open '.vbp could not be loaded'. If i try to open the individual forms, some of them work (open in vb6), some of them produce error .log file with two class errors : Class TabDlg.SSTab of control mstTabArticles was not a loaded control class. Line 3672: Class MSComCtl2.DTPicker of control dtpTicketDate was not a loaded control class.
I cannot open the vbp in notepad neither (=empty) and in wordpad i only get small squares...
Any help please?

Your .vbp file is corrupt. You will either need to restore from your backup or source control (you do have both of those don't you?).
Failing that, you will need to recreate the project file from scratch and readd each of the forms. You'll need to figure out what controls and references were loaded though.
As for the errors when loading the form files, this is normal as the controls have not been added to the project.

One other possibility is to open your file with a hex editor. You may be able to rescue a good deal of the text from the corrupt file and copy it to a new one.

Related

adding .dll file to visual studio, and open in the code

Hi I currently have a uni course in f#, where i need to use a .dll file that my professor made, in my code. In this picture, the parser.dll file has a red circle around it, and the current f# file has a blue:
Now the parser.dll is a parser that i need to pass some strings to, and get some output in my f# program.
My professor is for some reason able to acces this file by simply putting the parser.dll file in the current directory. When i do this in visual studio, the .dll file is hidden in the file explorer, and i am not ablue to acces it in the code either.
Now i could read some places that it could be a good idea to create references to it in the solution explorer>add>Reference>Browse, and try to find it on my machine (tried a few different locations), it is still hidden to me in the browse tool.
What is the best thing for me to do? and why is my dll file hidden from me when I attempt to add it using the "browse feature"?
Thank you

Why is it bad to edit the UIMap.designer.cs file in a Visual Studio Coded UI test?

I have read that it is bad to edit the UIMap.Designer.cs file, however, I do not understand why.
Per MSDN:
"Do not modify the UIMap.designer.cs file directly. If you do this, the changes to the file will be overwritten." http://msdn.microsoft.com/en-us/library/dd380782.aspx
Does anybody know what gets overwritten? Does this mean that if the UIMap.uitest file is edited after the Designer file, the designer file gets reversed? please help.
The UIMap.designer.cs file is regenerated from the UIMap.uitest file after every edit (that is saved) to the UIMap.uitest file. There is a comment at the top of the file saying that it is a generated file and that edits will be lost.
Large numbers of changes that, at first sight, appear to need editing of code in the designer file can be done by editing via the properties panels of the actions and UI-controls shown in the UIMap editor. Some changes do need manual editing. For these there is a command (button or right-click-menu) to move an action into the UIMap.cs file where it can be edited and extended as much as desired. Both of these UIMap...cs files specify partial in their class headers so both contribute to the same UIMap.
When just one action of a method needs manual editing it can be worth splitting that method into two or three pieces to place the action needing edits into its own method. The split command is available via a button or the right-click-menu. Having isolated the action, its method can be moved into the UIMap.cs file.
When moving methods and then editing them I recommend the following order of activity.
If needed: Split the method into pieces then rename the split methods using the UIMap editor. Save the UIMap.uitest file causing regeneration of the designer file. Then add calls to the split and renamed methods. Build the test and, perhaps, check that the test still works as expected.
Move method into the UIMap.cs file using the UIMap editor.
Save all files causing regeneration of the designer file. Omitting this save-all can cause confusing errors to be displayed on the C# files.
Edit the code just moved into the UIMap.cs file.
The UI Map editor is standard with Visual Studio 2012. For Visual Studio 2010 the editor was added by Feature Pack 2.
another option is to create another Class file for example, create Class1.CS and move all the code from UIMap.Designer.cs and UIMap.cs to Class1.cs. Now whenever you record anything, the regenerated code will be automatically generated in UIMap.Designer.cs file so just copy the same code to Class1.cs and change the code there if needed, and while running the main test just call this.Class1.launch(); it will run the codedTest.
It will also save you from splitting of methods in UIMap.uitest and then moving it to UIMap.cs
and even there will be a separate class including all your changes to the codedUItest.
Open the UIMap.uitest file in Visual Studio and click the 'Move code to UIMap.cs'
your function will move from designer.cs to UiMap.cs

when viewing details of a shelveset, when i double click the .cs or .sql files, why it opens in notepad?

i have gone through the this post and it says that the files take the automatic behavior of the windows to open the .cs and .sql files.
in my case when i open these files from a folder it opens up correctly in vs and sql server for .cs and .sql respectively.
Can anyone tell me how to open a file in a shelve in any editor other than notepad?
i have also checked the file types tab in folder options.
I believe you are using the VS Shelveset Dialog which is modal - maybe that's the reason "they" designed the View function to spawn a new process of notepad. It's unfortunate because for some file types, the editor is not VS but it will still bring up notepad. This is consistent with all other TFS related operations in VS. with changesets, you can view files in VS or other editor, when you look at any non-modal dialog (history for a single file for example)
So unfortunately without hacking around there's no way to change this behavior.

Export Visual Studio Template error: "Unable to read an exported file"

When exporting a Visual Studio project to a Template (File/Export Template...) I get the following error upon clicking the Finish button:
Unable to read an exported file for the following
reason: The file cannot be opened with the selected
editor. Please choose another editor.
Screenshot http://img687.yfrog.com/img687/1756/templateerror.png
A Google search for this error has only led to several dead ends. There aren't any unusual file types in this project. Any ideas what could be going on?
By laborious trial and error (start with an empty project, add a folder, try to export template) I was able to narrow this down to a single Javascript file. As it happens, it's one of the language definitions for prettify.js (which is used on this site for code coloring). The file in question is lang-hs.js, and for some reason Windows on my machine treats this file differently from other Javascript files: It opens in Notepad, when I have the .js extension mapped to Visual Studio.
I'm not sure what the underlying explanation is, but I've already wasted enough time on this and I believe I can live without Haskell code coloring (!) so I'm just deleting this file and moving on.
It seems ".cur" files are often a culprit in this error. I have removed them from my project and now the exportation works correctly.
Microsoft staff suggest looking at log files (../windows/system32/compmgmt.msc) but this error does not spawn an entry into the Application EventLog.

Visual Studio open files question

Is it possible to open a project in Visual Studio 2008 without opening all the files that were previously opened last time I had the project open. I have a habit of keeping many files open as I am working on them, so next time I open the project, it (very slowly) loads up a bunch of files into the editor that I may not even need open. I have searched through the settings and cannot find anything to stop this behavior.
Simply delete the .suo file.
It contains the list of open files.
A bit of research turns up the fact that you can do it with a macro:
Create a new macro (or use an existing one). You should see a module called EnvironmentEvents in Macro Explorer. (For details, see here.)
Open the EnvironmentEvents module.
Put in this code:
Public Sub CloseDocsOnExit() Handles SolutionEvents.BeforeClosing
DTE.ExecuteCommand("Window.CloseAllDocuments")
End Sub
Save and Build the macro.
Open a whole bunch of documents in your solution, then close Visual Studio.
Yay! No more open documents!
(Note: Despite that it says SolutionEvents, it also works if you're working on a project that doesn't have a solution.)
I never realized how much that annoyed me as well! I haven't been able to find a setting, but in Options > Environment > Keyboard you can bind a shortcut to Window.CloseAllDocuments. ALT+X was unbound for me so I just used that. I'm interested if there's some hidden setting to automatically do this on solution exit though (or load).
Edit: Totally read the question wrong at first - ignore my first (now gone) answer. :)
I changed the keyboard mapping for CTRL-SHIFT-C from bringing up the Class View to closing all document windows - something I use several orders of magnitude more often - and then I just clear my workspace before closing a solution.
Try the following:
Close the program after closing all files.
Make a copy of [whatever].suo
Open the solution again, open some files, and exit.
Copy (don't move) the old .suo file over the one that was just generated.
Make the .suo file read only.
If you have a repository you might want to check that file in.
I suggest this because I was having the reverse problem, where it wasn't opening my old files automatically, and the cause was a .suo file that had been checked into the repository and was (for some reason) not being overwritten by Studio. The file wasn't even write protected.
I was hoping for something a little more automatic. VS will create a new .suo file every time the project is saved. So I would have to delete that file every time I open the project. I also don't want to have to remember to close all the files before closing VS.
Other IDEs that I have used have similar functionality, but also make it rather simple to turn on/off.
Thanks for your help.
Or you can close all open document from the Window menu before closing VS.
In Visual Studio 6.0 (VC++), the procedure is slightly different.
Delete the .ncb file (located normally in the same place as your .dsp or .dsw files).
The only way works for me is : change the project location and again reopen the solutions form there. :)

Resources