How do I edit work items in the Visual Studio 2008 xml editor? - windows

I'm trying to customize some TFS work items via the VS2008 xml editor, but every time I open a work item xml file it jumps to the graphical designer. All that gives me is a "View XML" button that doesn't let you edit the xml directly.

I don't have TFS but I know in regular VS there is an Open With... option in most items' contextual menu that even let you change the default editor. Very useful when you are tired of the Designer opening instead of the Code file on Windows forms.

Ah, looks like you have to go to File->Open and click the down arrow next to the Open button to "Open With" the xml editor. If someone wants to copy and paste this, free accepted answer :P

As per Coincoin's answer, this feature is also great for setting the default editor for ASPX. If you want to go to the Code Editor most often, then this is a default you'd want to change.

Reading this - I think perhaps you don't realize - that there is no need to edit the XML - in fact it is very difficult to do so. The graphical designer will actually let you change the Work Item type, adding new fields, changing workflow, rules etc.
The only reason to change the XML is if there's a bug in the Process Editor (the tool that gives the graphic designer). I have done extensive modifications of Work Item types and only had one instance where I had to change the XML.

Related

Turn Off XAML error underlining

This is a simple issue, and I hope someone can help
For reasons I don't think I need to explain, my XAML thinks it has some errors in it in the Visual Studio code editor (which shows as wavy blue underlines across most of my XAML).
Does anyone know how to turn this underlining off in Visual Studio 2012 ?
It's incredibly annoying, and makes my XAML hard to read
Thanks
I would suggest setting the editor for .xaml-files manually.
Go into
Tools->Options->Text Editor->File Extension
Write xaml in the Extension field and choose XML (Text) Editor from the Editor drop down and then click Add.
Your XAML files should now open as ordinary XML files, without error underlining.
You will probably loose a lot of the nice to have features of the XAML editor, but as far as I know (I've struggled a bit with this myself) it is the only way.
Found this on MSDN. There is a specific setting to disable this.
Open the Options dialog by selecting Tools > Options, and then select
Text Editor > XAML > Miscellaneous.
Uncheck the Show errors detected
by the XAML designer check box.
Article from MSDN
It is possible to hide the SquiggleShape by making the surrounding adornment layer hidden or collapsed using the Snoop tool.
To achieve this, the Snoop crosshair tool has to be dragged on the editor window with shift and ctrl keys pressed (keep them pressed a while when releasing mouse button). You should end on some Canvas (with the editor window highlighted), and below there is some ViewStack. Inside, there are some AdornmentLayer, one of which contains multiple SquiggleShape. In the properties section on the right side of the Snoop window, scroll to the Visibility row and select the value Hidden or Collapsed. Now, the squiggle lines are not visible any more.
This involves some manual work, but as long as the file stays open, the squiggle lines are hidden. In principle, it should be possible to write an extension which hides the lines automatically. However, at the moment I don't find the time to do this...
The only decent fix for this silly bug that I can find is right click on the xaml and click open with. Select source code editor (without with encoding). Not a great fix when you consider it gets rid of important errors. But it should help you read it better for the most part.
Another Option for this is to change the color of the line under: Tools > Options > Environment > Fonts and Colors. Change it to the same as the background.
It will turn it off in all other editors also though.

Is there a way to record and replay coding in visual studio 2012?

I'm going to do demo based presentation. So what I want is prerecord(not a video record) my demo and replay while the I'm doing the presentation. Pre-record and play as in save code segments and generated some kind of list and then when I click on the list item generate relevant code and insert into code editor. Is there any macro base or any other way to do this?
Please do ask question if this is not clear.
Update 1
#jerek has answered the initial question. Going forward is there anyway to replace/edit existing code?
Open Toolbox (View | Toolbox)
Select code from editor
Drag and Drop into Toolbox (you can give it a short name from context menu)
When needed drag and drop back from Toolbox back to code editor
PS: 3b - instead of drag and drop you can also paste code from clipboard using context menu on Toolbox window
The Undo and Redo stack buttons are really useful. They might be enough for what you want to do (basically CTRL-Z and CTRL-SHIFT-Z but you can roll forward over multiple redo's)
This might be a bit basic, but essentially will allow you to go forwards and backwards through your edits.
With Visual Studio, you can code everything and then undo and redo your work. Then record everything with one of these.

Visual Studio: quick access to most used files

The solution I work on is quite big so it can require a lot of clicks to get to the desired file. I spend 90% of the time working with 8-10 files from this solution so it would be really convenient to have some kind of "Favorites" in my solution so I could jump to the most used files quickly. "Recent files" doesn't cut it, so maybe you know some extensions for VS2010 that do that? Google didn't provide any good options so I decided to give it a shot here and ask what do you use.
Thanks in advance
It's not quite what you asked for, but it'll help endlessly:
In vanilla VS2010, hit Ctrl-Comma (by default) for the "Navigate To" window. You can type a partial file, class or method name and it'll show you a list of where that appears in your solution, and you can open directly from there.
The DevExpress plugins also have a "Recently Used File" window (Ctrl-Shift-Period by default, I think) that does similar, but only shows files you've recently used (not classes or methods). I have to say, though, I've not used that since I've had VS2010.
Wow! A question since 2011 that is still valid to date.
From View Menu click Bookmark Window
open your favorite file
click any line - preferably the beginning of the file
from the Bookmarks Window, click the icon "Toggle a bookmark on the current line."
Very convenient!
Haven't tried this particular feature of the PowerTools myself, but it could do the trick:
http://blogs.msdn.com/b/visualstudio/archive/2010/08/03/quick-access-extension.aspx

Customizing toolbar items in VS2010

Has the menu & toolbar customization functionality in VS2010 been reduced?
I can't seem to be able to select an icon for an added command, nor set it to be icon-only. Previous versions of Visual Studio supported this functionality and even allowed the creation/editing of custom icons.
Is this something that has suffered as a result of the move to the WPF-authored UI or am I missing something?
Seems like this functionality was cut from Visual Studio 2010. This post has some info in the comments: Customizing Visual Studio 2010
Specifically - "Unfortunately assigning or editing icons to commands through Customize dialog is not possible in VS2010. It is one of the features got cut for lack of time. This is however something we'll consider adding back in next version."
The reply also has a longer explanation of a workaround.
As noted in the link mentioned in the answer from #Gordon Mackie JoanMiro, the REASON for the reduced functionality is that the VS Shell team migrated the entire UI (shell and command system) from Win32 to one based solely on WPF. This was a gargantuan task, I would imagine. However, a couple workarounds are now available:
You can export previously saved settings from VS 2008 and import them into VS 2010. That includes command bar customizations (as noted by #Don)
A more recent blog-post contains detailed instructions for using a new extension to VS2010 (available on Visual Studio Gallery) that allows users to change the images on the command UI. (Note that the old drag&drop customization interface is still not supported in this new extension.)
If you have custom icons, any attempt to make ANY changes to the tool bar will result in the custom icons disappearing and being replaced by text when you restart VS2010.
The only way I found to get my custom icons without text into VS2010 is to open VS2008, set up all of the tool bars the way I want, including custom icons, then export the settings (Tools| Import and Export Settings). Then open VS2010 and import those settings. Tedious, I know, but it allows me to have a down arrow icon that searches for the next instance of the word my cursor is on.
I have been trying to customize VS2010 toolbars/keyboard and what took a few minutes in previous versions takes hours now. The new system looks real pretty but is useless in practice. Apart from the fact you just can't do (like change the appearance of buttons as mentioned above) the things you can do are extremely time-consuming and annoying.
Why is it every new version of VS loses something really useful? Other examples:
VC++5 introduced a new HTML help system. Pressing F1 on a function name used to immediately show help for that function. After VC++5 getting context help became annoyingly much slower, and is still very slow (and inaccurate).
VS.Net (aka VS2002 or VC++7) had a useless bookmark system compared to VC++6. VS2010 bookmarks are better but not perfect.
VS.Net removed the search state buttons "whole word", "case sensitive" etc. These were possibly the most useful buttons ever as they quickly allowed you to see why a search may have failed.
I found a great extension: CommandingImage
It does not have an icon editor, but you can create your images as 16x16 png format (for transparency) and import it (I recommend Paint.Net)
Dave, here's how to add toolbar buttons:
1) in the IDE, find the down arrow looking thing on the far right of a toolbar and click on Add Remove Buttons, Customize
2) in the Customize window select the Menu Bar radio button then select the appropriate menu bar that you want to add a button to
3) click the "Add Command..." button
4) select the appropriate Category and Command button that you want to add, then click OK.
The command button you selected will be added to the menu bar you selected. You can move the button up or down.
I think this is what you are looking for.
Good luck!

Visual Studio 2005: Please stop opening my CS files in "Design Mode"!

I think it's associating my Web Service's CS files with the related ASMX files. But whatever's happening, I can't double-click to open the CS files - I have to "view Code" or it opens in the designer.
Anyone know how to turn off this automatic behavior? I just want to edit the code!
Try right-clicking, select "Open with...", mark "CSharp Editor" and select "Set as Default".
That works for avoiding the WinForms Designer.
I found this question when trying to deal with a similar problem. I had a C# class in a file and whenever I double clicked on the file it would try to open in design mode but design mode was meaningless for this class. I just want to see the code.
I found that adding the [System.ComponentModel.DesignerCategory("")] attribute to my class fixed this.
In the Solution Explorer view, click the "Show All Files" icon. This will put "+" symbol next to each of your files. Click the + and it will expand to show the .CS file which holds the ASMX's code. At this point, double click that file instead.
For some reason VS2005 seems to have this a bit backwards when it comes to webservices. To open a webservice in code view, double-click the .asmx file, not the .asmx.cs file.
I guess it makes a bit of sense, as there's nothing to "design" when it comes to a webservice, but it's counterintuitive if you've been working with .aspx files.
In my experience, if you find that the wrote editor, that is the non-default editor, is opening when double-clicking on a file within the Solution Explorer then something is wrong with the underlying project's User Options file (.user) or the solution's User Options file (.suo). (I am not sure which, but I suspect the settings are stored in the .suo file.) Deleting the the .suo and all project .user files solved the problem.
I personally, set the Form Editor as my default editor for forms at the beginning of a project. After the forms are stable and require less user-interface design changes, I switch the default editor.

Resources