Posts tagged 'Dialog Boxes'

Friday, June 20, 2014

Tip 6.15: You can prompt for arguments when you run an external tool

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



To finish the customization of the external tools, you can check Prompt For Arguments if you need to enter or edit values each time you run the tool.

VSTip6115

So now, if she needs to specify which file she wants Notepad to open, she's prompted for the file name, which is the argument for notepad.exe.

VSTip6115a

And recall that you can set the Initial Directory, where Notepad is going to look for files.

Happy Programming! =)
Posted by Nils-Holger at 11:58 AM with 437 comments.

Thursday, June 19, 2014

Tip 6.14: How the external tools tokens work

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



She has hinted at a few of the external tool tokens, but let's explore a little more. Most of these are self-explanatory and are explored in depth in the documentation, but here she'll give you a high-level overview. You can view the documentation at http://msdn.microsoft.com/en-us/library/ekbzk5f8.aspx.

All Item and Current tokens that are available for the Arguments edit box operate on the currently active editor. Note the editor does not need to have focus to be able to work, but it must at least have inactive selection.

VSTip6114

For the Initial Directory edit box, you'll find all the directory tokens, but one in particular to call out is the Binary Directory. Note the Binary Directory option is new for Visual Studio 2008.

VSTip6114a

The Target Directory token targets the obj directory (\obj\Debug\), but if you need the final bits that go into the bin directory (\bin\Debug\), use the Binary Directory token.

Happy Programming! =)
Posted by Nils-Holger at 12:01 PM with 444 comments.

Wednesday, June 18, 2014

Tip 6.13: You can have your external tool's text displayed in the Output window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



At the bottom of the External Tools dialog box, you'll see more options for customizing the external tool within the IDE. This tip is about the Use Output Window option. The idea here is you're running a .bat file and you want to track the progress within the IDE.

Using the command prompt as the tool, you can set Arguments to something like /C echo $(CurText), which signifies the following:
  • /C, from cmd.exe, carries out the command specified by the string and then terminates.
  • $(CurText) is a token that comes from Visual Studio that represents the currently selected text, displayed as Current Text in the menu.


VSTip6113

Now, when running this external tool with a line of text selected in the editor, the Output window displays the text.

VSTip6113a

Happy Programming! =)
Posted by Nils-Holger at 12:25 PM with 3 comments.

Tuesday, June 17, 2014

Tip 6.12: You can rearrange the list of external tools and create mnemonics

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Continuing with the newly added Notepad tool from the previous tip, you can use the External Tools dialog box to sort your list of external tools as they will appear on the Tools menu. To the right of the Menu Contents list, you'll find the Move Up and Move Down buttons.

VSTip6112

You can specify a mnemonic, also known as a keyboard accelerator, by putting an ampersand in front of the letter to be used as the accelerator in the Title field.

VSTip6112a

Now, on the Tools menu, you can simply press n to launch Notepad.

VSTip6112b

If there's a mnemonic conflict, the focus cycles among the commands that share that mnemonic. Then you press Enter at the appropriate command to execute the command. It is ideal to have no conflicts.

Happy Programming! =)
Posted by Nils-Holger at 12:01 PM with 445 comments.

Monday, June 16, 2014

Tip 6.11: You can add your own external tools to the list

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



For this tip, let's add Notepad as an external tool.

Go to the Tools–External Tools dialog box, and you'll see the Add button. Click Add to create a [New Tools 1] placeholder. Rename the title by typing Notepad.

For the Command edit box, use the name of the actual executable. You should be able to just type notepad.exe, depending on your environment variables.

VSTip6111

This is the minimum amount of information you need to include to make an external tool work. But let's go a little further by exploring the optional arguments.

For Arguments, you can type the name of a file, either an existing file if you want Notepad to open it or the name of a file if you want Notepad to create.

For Initial Directory, you can type the file path, either the path where the file exists or where you want Notepad to create it.

And of course, you'll see Notepad now in the Tools menu.

VSTip6111a

We'll explore more of the arguments and other options in the upcoming tips.

Happy Programming! =)
Posted by Nils-Holger at 9:13 AM with 435 comments.

Sunday, June 15, 2014

Tip 6.10: You can run external tools from the IDE

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Sara Aside

Okay she has to admit, she's not the local expert in External Tools. She can talk about the functionality all day long, but nothing is better than real-world examples. When she blogged about this tip, she asked blog readers to leave comments about how they use this feature. You can see their comments at http://blogs.msdn.com/b/saraford/archive/2008/04/24/did-you-know-you-can-run-external-tools-within-visual-studio-201.aspx.


Let's start with the basics. Go to Tools–External Tools to bring up the External Tools dialog box. You'll notice a set of built-in tools ready to go for you.

VSTip6110

This list of tools under Menu Contents maps directly to the list presented on the Tools menu, as shown here:

VSTip6110a

Sara Aside

The first time she made this connection she was totally taken aback. She probably saw this list of tools for years, but she never knew it came directly from the External Tools dialog box.


Happy Programming! =)
Posted by Nils-Holger at 11:41 AM with 446 comments.

Saturday, June 14, 2014

Tip 6.9: You can use team settings to keep Visual Studio settings on different machines in sync

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Under Tools–Options–Environment–Import And Export Settings, you'll see an option called Use Team Settings File.

This option enables you to let all the members of your team use the same baseline settings. You can provide a .vssettings file (by creating these customizations on your machine and then using Tools–Import And Export Settings–Export to create the file). Then put the .vssettings file on a Universal Naming Convention (UNC) share. Next, you check the Use Team Settings File check box, pointing it at this file.

VSTip6900

So, what happens now? Whenever Visual Studio launches, it'll check the time stamp of the .vssettings file, and if there has been an update, Visual Studio will reapply all the settings from the .vssettings file. But be aware, if you have any custom changes, they will be overwritten when Visual Studio detects the new team settings file.

She thinks that this works really well in a scenario where there's a single developer who works on multiple computers, because any tweaks the developer makes on one machine will be carried over to the next machine.

Happy Programming! =)
Posted by Nils-Holger at 12:11 PM with 435 comments.

Friday, June 13, 2014

Tip 6.8: You can copy the full file path from the final wizard page when exporting settings

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



This tip is more like a "tip" than her usual "micro functionality" daily tips. After you export, the final page of the wizard shows you the full file path. This page is just a read-only edit box that can take focus. In other words, you can put your cursor in it and copy the full file path.

VSTip6800

After you export your settings, you may want to open the file and see what's there, in case you want to make any tweaks. Otherwise, you'll have to open the Import And Export Settings dialog box and go through the wizard to guess where you exported that file to.

Happy Programming! =)
Posted by Nils-Holger at 11:08 AM with 759 comments.

Thursday, June 12, 2014

Tip 6.7: How Visual Studio automatically saves all your current settings every time you close it

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



On the Tools–Options–Environment–Import And Export Settings (yes, the Tools–Import And Export Settings dialog box has its own Tools Options page), you'll find the option that lets you choose where to store your current settings. Note that you don't get to opt out of this. Prior to Visual Studio 2005, settings categories were saved in separate files in %appdata%, such as a file for all your toolbox customizations, your window layouts, your keyboard shortcut bindings, and your command bar changes. Starting in Visual Studio 2005, those settings are now stored in a centralized file called the CurrentSettings.vssettings file by default.

VSTip6700

Every time Visual Studio shuts down, it writes to this file location to keep your current settings saved. If you ever make a change that you need to quickly back out of, you can always go to Tools–Import And Export Settings–Import and choose the CurrentSettings.vssettings file, located in the My Settings folder.

VSTip6700a

Happy Programming! =)
Posted by Nils-Holger at 12:40 PM with 439 comments.

Wednesday, June 11, 2014

Tip 6.6: You can save your current settings prior to doing an Import or Reset

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Sara Aside

Sometimes "Tip of the Day" isn't about stating the obvious; it's about stating the nonobvious. A lot of times, there's functionality that seems trivial on the surface, but one-off things occur at a deeper level, as seen in Tip 6.5. Fortunately, this tip is trivial. No hidden operations going on under the UI that she has to explain.


Whenever you do a destructive operation via Tools–Import And Export Settings, such as importing or resetting your settings, Visual Studio prompts you to save your current settings prior to continuing. This operation is the same as doing a full export (that is, going to the Export page and checking everything to export to a file).

VSTip6600

The one thing she'll call out is that the Store My Settings File In This Directory combo box will remember any location where you've exported a file to, because you may wish to save your current settings there again in the future.

Happy Programming! =)
Posted by Nils-Holger at 12:55 PM with 433 comments.

Tuesday, June 10, 2014

Tip 6.5: What's the difference between resetting settings and importing settings?

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Whenever she demos Tools–Import And Export Settings, she's usually asked to explain the difference between the Import feature and the Reset feature. From an end-user perspective, importing everything in that particular settings file provides the same functionally as a reset.

VSTip6500

But of course, there's more going on under the UI surface. Whenever you do a reset, the IDE stores the path of the file you picked to reset to in the registry. There are some shortcuts within the IDE to quickly reset those settings. Following are a couple of the most common of these quick reset options. First, on the Tools–Options–Environment–Fonts And Colors page, you'll see the Use Defaults option. This option resets your fonts and colors using the settings file you last reset to.

VSTip6500a

Second, on the Window menu, there's the command Reset Window Layout. This command resets your window layouts (that is, all your tool windows in all four window layout states) using the settings file you last reset to.

VSTip6500b

But ... What if you attempt to reset using a file you last reset to that didn't contain this particular category? For example, let's say you last reset to your own settings file and it didn't contain the Window Layouts category. Then she believes Visual Studio uses its factory defaults (the legacy settings that were built in for Visual Studio .NET 2003, the version before the Import And Export Settings feature was built) whenever you do Windows–Reset Window Layout. She recalls during one of the many Profiles feature design meetings the term schizophrenia being used to describe the possible states Visual Studio could end up in. =D

Happy Programming! =)
Posted by Nils-Holger at 11:58 AM with 440 comments.

Monday, June 9, 2014

Tip 6.4: You can add your own files to the Import And Export Settings–Reset page list

"Visual Studio Tips, 251 Ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



If you go to the Reset page on the Tools–Import And Export Settings Wizard, you'll see the list of files you can reset to. These settings files are the ones created by the Visual Studio team. But, let's say that one of the default files has some small option that just annoys you or you want to add your own file to the list, as shown here:

VSTip6400

These files live at \Program Files\Microsoft Visual Studio 10.0\Common7\IDE\Profiles. You'll need administrator rights to access Program Files, so please use this tip at your own risk.

In this folder, you can add your own .vssettings files or modify the existing ones. She uses the General Development Settings, but any time she does a reset, the Tools–Customize–Show Shortcut Keys In ScreenTips option becomes unchecked. This option shows you the keyboard shortcut for a toolbar button in the ToolTip, a visual cue she absolutely must have.

If you find yourself in a similar situation, where you want to make small tweaks to one of the default settings files provided, you can do the following:
    1. Reset to General Development Settings.
    2. Enable the setting or settings you prefer.
    3. Do a full export (for example, check all options in the Export page), and write over the General Development Settings.
    4. Copy this file over the existing General Development Settings file that lives in \Program Files.
The next time you reset using these settings, you'll see your preferred settings. And in her case, she'll see her keyboard shortcuts in her ToolTips!

Happy Programming! =)
Posted by Nils-Holger at 11:10 AM with 646 comments.

Saturday, June 7, 2014

Tip 6.2: How to reset your environment settings via Tools–Import And Export Settings

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



The most popular question she sees about Visual Studio IDE is how to reset the environment settings. Starting in Visual Studio 2005, the IDE prompts you on first launch to pick your development settings. If you need to reset back to what you picked or want to pick previously saved settings or predefined settings, go to Tools–Import And Export Settings to launch the wizard, and choose Reset All Settings.

VSTip6200

On the next page you decide whether you want to save your current settings. If this is your first time using this dialog box or you want to experiment with this feature, or both, definitely choose to save your settings. The default is to save your settings, so go with the default if you are unsure.

VSTip6200a

The following page is much more interesting. You may notice this list looks familiar. It should, because this is the same list from that first launch dialog box that prompts you to pick your preferred environment settings. These files contain default settings for features such as keyboard shortcut bindings, tool window layouts, project template layouts, and many, many more.

VSTip6200b

Choose your IDE settings by clicking Finish. Visual Studio lets you know whether any issues arose with regard to resetting your settings.

VSTip6200c

Happy Programming! =)
Posted by Nils-Holger at 1:34 PM with 448 comments.

Friday, June 6, 2014

Tip 6.1: How to find what development settings you last reset to

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Maybe you don't remember what you picked during your first launch of Visual Studio or what you last reset to. Under the HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\Profile key, you'll see the LastResetSettingsFile value. As previously mentioned, the code name for this feature was Profiles, hence the word Profile is used as the key. In the following example, you'll notice how she's using the Visual Basic Settings.

VSTip6100

If you haven't reset any settings since launching Visual Studio, this value tells you this is what you picked at first launch.

Happy Programming! =)
Posted by Nils-Holger at 12:22 PM with 437 comments.

Thursday, October 10, 2013

Tip 6.15: You can prompt for arguments when you run an external tool

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



To finish the customization of the external tools, you can check Prompt For Arguments if you need to enter or edit values each time you run the tool.

VSTip6115

So now, if she needs to specify which file she wants Notepad to open, she's prompted for the file name, which is the argument for notepad.exe.

VSTip6115a

And recall that you can set the Initial Directory, where Notepad is going to look for files.

Happy Programming! =)
Posted by Nils-Holger at 1:17 PM with 0 comments.

Wednesday, October 9, 2013

Tip 6.14: How the external tools tokens work

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



She has hinted at a few of the external tool tokens, but let's explore a little more. Most of these are self-explanatory and are explored in depth in the documentation, but here she'll give you a high-level overview. You can view the documentation at http://msdn.microsoft.com/en-us/library/ekbzk5f8.aspx. All Item and Current tokens that are available for the Arguments edit box operate on the currently active editor. Note the editor does not need to have focus to be able to work, but it must at least have inactive selection.

VSTip6114

For the Initial Directory edit box, you'll find all the directory tokens, but one in particular to call out is the Binary Directory. Note the Binary Directory option is new for Visual Studio 2008.

VSTip6114a

The Target Directory token targets the obj directory (\obj\Debug\), but if you need the final bits that go into the bin directory (\bin\Debug\), use the Binary Directory token.

Happy Programming! =)
Posted by Nils-Holger at 1:03 PM with 438 comments.

Tuesday, October 8, 2013

Tip 6.13: You can have your external tool's text displayed in the Output window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



At the bottom of the External Tools dialog box, you'll see more options for customizing the external tool within the IDE. This tip is about the Use Output Window option. The idea here is you're running a .bat file and you want to track the progress within the IDE.

Using the command prompt as the tool, you can set Arguments to something like /C echo $(CurText), which signifies the following:
  • /C, from cmd.exe, carries out the command specified by the string and then terminates.
  • $(CurText) is a token that comes from Visual Studio that represents the currently selected text, displayed as Current Text in the menu.


VSTip6113

Now, when running this external tool with a line of text selected in the editor, the Output window displays the text.

VSTip6113a

Happy Programming! =)
Posted by Nils-Holger at 12:24 PM with 3171 comments.

Monday, October 7, 2013

Tip 6.12: You can rearrange the list of external tools and create mnemonics

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Continuing with the newly added Notepad tool from the previous tip, you can use the External Tools dialog box to sort your list of external tools as they will appear on the Tools menu. To the right of the Menu Contents list, you'll find the Move Up and Move Down buttons.

VSTip6112

You can specify a mnemonic, also known as a keyboard accelerator, by putting an ampersand in front of the letter to be used as the accelerator in the Title field.

VSTip6112a

Now, on the Tools menu, you can simply press n to launch Notepad.

VSTip6112b

If there's a mnemonic conflict, the focus cycles among the commands that share that mnemonic. Then you press Enter at the appropriate command to execute the command. It is ideal to have no conflicts.

Happy Programming! =)
Posted by Nils-Holger at 12:26 PM with 437 comments.

Sunday, October 6, 2013

Tip 6.11: You can add your own external tools to the list

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



For this tip, let's add Notepad as an external tool. Go to the Tools–External Tools dialog box, and you'll see the Add button. Click Add to create a [New Tools 1] placeholder. Rename the title by typing Notepad. For the Command edit box, use the name of the actual executable. You should be able to just type notepad.exe, depending on your environment variables.

VSTip6111

This is the minimum amount of information you need to include to make an external tool work. But let's go a little further by exploring the optional arguments. For Arguments, you can type the name of a file, either an existing file if you want Notepad to open it or the name of a file if you want Notepad to create. For Initial Directory, you can type the file path, either the path where the file exists or where you want Notepad to create it. And of course, you'll see Notepad now in the Tools menu.

VSTip6111a

We'll explore more of the arguments and other options in the upcoming tips.

Happy Programming! =)
Posted by Nils-Holger at 12:51 PM with 552 comments.

Saturday, October 5, 2013

Tip 6.10: You can run external tools from the IDE

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Sara Aside

Okay she has to admit, she's not the local expert in External Tools. She can talk about the functionality all day long, but nothing is better than real-world examples. When she blogged about this tip, she asked blog readers to leave comments about how they use this feature. You can see their comments at http://blogs.msdn.com/b/saraford/archive/2008/04/24/did-you-know-you-can-run-external-tools-within-visual-studio-201.aspx.


Let's start with the basics. Go to Tools–External Tools to bring up the External Tools dialog box. You'll notice a set of built-in tools ready to go for you.

VSTip6110 This list of tools under Menu Contents maps directly to the list presented on the Tools menu, as shown here:

VSTip6110a

Sara Aside

The first time she made this connection she was totally taken aback. She probably saw this list of tools for years, but she never knew it came directly from the External Tools dialog box.


Happy Programming! =)
Posted by Nils-Holger at 12:09 PM with 437 comments.

Friday, October 4, 2013

Tip 6.9: You can use team settings to keep Visual Studio settings on different machines in sync

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Under Tools–Options–Environment–Import And Export Settings, you'll see an option called Use Team Settings File. This option enables you to let all the members of your team use the same baseline settings. You can provide a .vssettings file (by creating these customizations on your machine and then using Tools–Import And Export Settings–Export to create the file). Then put the .vssettings file on a Universal Naming Convention (UNC) share. Next, you check the Use Team Settings File check box, pointing it at this file.

VSTip6900

So, what happens now? Whenever Visual Studio launches, it'll check the time stamp of the .vssettings file, and if there has been an update, Visual Studio will reapply all the settings from the .vssettings file. But be aware, if you have any custom changes, they will be overwritten when Visual Studio detects the new team settings file.

She thinks that this works really well in a scenario where there's a single developer who works on multiple computers, because any tweaks the developer makes on one machine will be carried over to the next machine.

Happy Programming! =)
Posted by Nils-Holger at 1:14 PM with 440 comments.

Thursday, October 3, 2013

Tip 6.8: You can copy the full file path from the final wizard page when exporting settings

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



This tip is more like a "tip" than her usual "micro functionality" daily tips. After you export, the final page of the wizard shows you the full file path. This page is just a read-only edit box that can take focus. In other words, you can put your cursor in it and copy the full file path.

VSTip6800

After you export your settings, you may want to open the file and see what's there, in case you want to make any tweaks. Otherwise, you'll have to open the Import And Export Settings dialog box and go through the wizard to guess where you exported that file to.

Happy Programming! =)
Posted by Nils-Holger at 12:58 PM with 1014 comments.

Wednesday, October 2, 2013

Tip 6.7: How Visual Studio automatically saves all your current settings every time you close it

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



On the Tools–Options–Environment–Import And Export Settings (yes, the Tools–Import And Export Settings dialog box has its own Tools Options page), you'll find the option that lets you choose where to store your current settings. Note that you don't get to opt out of this. Prior to Visual Studio 2005, settings categories were saved in separate files in %appdata%, such as a file for all your toolbox customizations, your window layouts, your keyboard shortcut bindings, and your command bar changes. Starting in Visual Studio 2005, those settings are now stored in a centralized file called the CurrentSettings.vssettings file by default.

VSTip6700

Every time Visual Studio shuts down, it writes to this file location to keep your current settings saved. If you ever make a change that you need to quickly back out of, you can always go to Tools–Import And Export Settings–Import and choose the CurrentSettings.vssettings file, located in the My Settings folder.

VSTip6700a

Happy Programming! =)
Posted by Nils-Holger at 12:39 PM with 442 comments.

Tuesday, October 1, 2013

Tip 6.6: You can save your current settings prior to doing an Import or Reset

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Sara Aside

Sometimes "Tip of the Day" isn't about stating the obvious; it's about stating the nonobvious. A lot of times, there's functionality that seems trivial on the surface, but one-off things occur at a deeper level, as seen in Tip 6.5. Fortunately, this tip is trivial. No hidden operations going on under the UI that she has to explain.


Whenever you do a destructive operation via Tools–Import And Export Settings, such as importing or resetting your settings, Visual Studio prompts you to save your current settings prior to continuing. This operation is the same as doing a full export (that is, going to the Export page and checking everything to export to a file).

VSTip6600

The one thing she'll call out is that the Store My Settings File In This Directory combo box will remember any location where you've exported a file to, because you may wish to save your current settings there again in the future.

Happy Programming! =)
Posted by Nils-Holger at 11:57 AM with 443 comments.

Monday, September 30, 2013

Tip 6.5: What's the difference between resetting settings and importing settings?

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Whenever she demos Tools–Import And Export Settings, she's usually asked to explain the difference between the Import feature and the Reset feature. From an end-user perspective, importing everything in that particular settings file provides the same functionally as a reset.

VSTip6500

But of course, there's more going on under the UI surface. Whenever you do a reset, the IDE stores the path of the file you picked to reset to in the registry. There are some shortcuts within the IDE to quickly reset those settings. Following are a couple of the most common of these quick reset options. First, on the Tools–Options–Environment–Fonts And Colors page, you'll see the Use Defaults option. This option resets your fonts and colors using the settings file you last reset to.

VSTip6500a

Second, on the Window menu, there's the command Reset Window Layout. This command resets your window layouts (that is, all your tool windows in all four window layout states) using the settings file you last reset to.

VSTip6500b

But ... What if you attempt to reset using a file you last reset to that didn't contain this particular category? For example, let's say you last reset to your own settings file and it didn't contain the Window Layouts category. Then she believes Visual Studio uses its factory defaults (the legacy settings that were built in for Visual Studio .NET 2003, the version before the Import And Export Settings feature was built) whenever you do Windows–Reset Window Layout. She recalls during one of the many Profiles feature design meetings the term schizophrenia being used to describe the possible states Visual Studio could end up in. =D

Happy Programming! =)
Posted by Nils-Holger at 12:58 PM with 441 comments.

Sunday, September 29, 2013

Tip 6.4: You can add your own files to the Import And Export Settings–Reset page list

"Visual Studio Tips, 251 Ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



If you go to the Reset page on the Tools–Import And Export Settings Wizard, you'll see the list of files you can reset to. These settings files are the ones created by the Visual Studio team. But, let's say that one of the default files has some small option that just annoys you or you want to add your own file to the list, as shown here:

VSTip6400

These files live at \Program Files\Microsoft Visual Studio 10.0\Common7\IDE\Profiles. You'll need administrator rights to access Program Files, so please use this tip at your own risk.

In this folder, you can add your own .vssettings files or modify the existing ones. She uses the General Development Settings, but any time she does a reset, the Tools–Customize–Show Shortcut Keys In ScreenTips option becomes unchecked. This option shows you the keyboard shortcut for a toolbar button in the ToolTip, a visual cue she absolutely must have.

If you find yourself in a similar situation, where you want to make small tweaks to one of the default settings files provided, you can do the following:
    1. Reset to General Development Settings.
    2. Enable the setting or settings you prefer.
    3. Do a full export (for example, check all options in the Export page), and write over the General Development Settings.
    4. Copy this file over the existing General Development Settings file that lives in \Program Files.


The next time you reset using these settings, you'll see your preferred settings. And in her case, she'll see her keyboard shortcuts in her ToolTips!

Happy Programming! =)
Posted by Nils-Holger at 12:51 PM with 651 comments.

Saturday, September 28, 2013

Tip 6.3: What settings are contained in the New Project Dialog Preferred Language category

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



If you go to Tools–Import And Export Settings–Export Settings, you'll see the list of categories that can be contained in a .vssettings file. The first category she wants to discuss is the New Project Dialog Preferred Language category.



As noted in the description, it organizes the New Project Dialog folders based on the preferred language. If C# is preferred, all the C# projects are listed at the top of the list and all the others are collected toward the bottom. The General Development Settings use the defaults that have been familiar since the Visual Studio .NET 2002 days, as shown here:

VSTip6300a

Now let's see the dialog box using the Visual C# Development Settings. Note how Visual Basic and Visual C++ fall into the newly created Other Languages node.

VSTip6300b

Happy Programming! =)
Posted by Nils-Holger at 12:22 PM with 458 comments.

Friday, September 27, 2013

Tip 6.2: How to reset your environment settings via Tools–Import And Export Settings

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



The most popular question she sees about Visual Studio IDE is how to reset the environment settings. Starting in Visual Studio 2005, the IDE prompts you on first launch to pick your development settings. If you need to reset back to what you picked or want to pick previously saved settings or predefined settings, go to Tools–Import And Export Settings to launch the wizard, and choose Reset All Settings.

VSTip6200

On the next page you decide whether you want to save your current settings. If this is your first time using this dialog box or you want to experiment with this feature, or both, definitely choose to save your settings. The default is to save your settings, so go with the default if you are unsure.

VSTip6200a

The following page is much more interesting. You may notice this list looks familiar. It should, because this is the same list from that first launch dialog box that prompts you to pick your preferred environment settings. These files contain default settings for features such as keyboard shortcut bindings, tool window layouts, project template layouts, and many, many more.

VSTip6200b

Choose your IDE settings by clicking Finish. Visual Studio lets you know whether any issues arose with regard to resetting your settings.

VSTip6200c

Happy Programming! =)
Posted by Nils-Holger at 12:18 PM with 440 comments.

Thursday, September 26, 2013

Tip 6.1: How to find what development settings you last reset to

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Maybe you don't remember what you picked during your first launch of Visual Studio or what you last reset to. Under the HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\Profile key, you'll see the LastResetSettingsFile value. As previously mentioned, the code name for this feature was Profiles, hence the word Profile is used as the key. In the following example, you'll notice how she's using the Visual Basic Settings.

VSTip6100

If you haven't reset any settings since launching Visual Studio, this value tells you this is what you picked at first launch.

Happy Programming! =)
Posted by Nils-Holger at 12:07 PM with 0 comments.

Friday, January 25, 2013

Tip 6.15: You can prompt for arguments when you run an external tool

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



To finish the customization of the external tools, you can check Prompt For Arguments if you need to enter or edit values each time you run the tool.

VSTip6115

So now, if she needs to specify which file she wants Notepad to open, she's prompted for the file name, which is the argument for notepad.exe.

VSTip6115a

And recall that you can set the Initial Directory, where Notepad is going to look for files.

Happy Programming! =)
Posted by Nils-Holger at 12:12 PM with 443 comments.

Thursday, January 24, 2013

Tip 6.14: How the external tools tokens work

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



She has hinted at a few of the external tool tokens, but let's explore a little more. Most of these are self-explanatory and are explored in depth in the documentation, but here she'll give you a high-level overview. You can view the documentation at http://msdn.microsoft.com/en-us/library/ekbzk5f8.aspx. All Item and Current tokens that are available for the Arguments edit box operate on the currently active editor. Note the editor does not need to have focus to be able to work, but it must at least have inactive selection.

VSTip6114

For the Initial Directory edit box, you'll find all the directory tokens, but one in particular to call out is the Binary Directory. Note the Binary Directory option is new for Visual Studio 2008.

VSTip6114a

The Target Directory token targets the obj directory (\obj\Debug\), but if you need the final bits that go into the bin directory (\bin\Debug\), use the Binary Directory token.

Happy Programming! =)
Posted by Nils-Holger at 1:26 PM with 441 comments.

Wednesday, January 23, 2013

Tip 6.13: You can have your external tool's text displayed in the Output window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



At the bottom of the External Tools dialog box, you'll see more options for customizing the external tool within the IDE. This tip is about the Use Output Window option. The idea here is you're running a .bat file and you want to track the progress within the IDE. Using the command prompt as the tool, you can set Arguments to something like /C echo $(CurText), which signifies the following:
  • /C, from cmd.exe, carries out the command specified by the string and then terminates.
  • $(CurText) is a token that comes from Visual Studio that represents the currently selected text, displayed as Current Text in the menu.


VSTip6113

Now, when running this external tool with a line of text selected in the editor, the Output window displays the text.

VSTip6113a

Happy Programming! =)
Posted by Nils-Holger at 2:04 PM with 890 comments.

Tuesday, January 22, 2013

Tip 6.12: You can rearrange the list of external tools and create mnemonics

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


Continuing with the newly added Notepad tool from the previous tip, you can use the External Tools dialog box to sort your list of external tools as they will appear on the Tools menu. To the right of the Menu Contents list, you'll find the Move Up and Move Down buttons.

VSTip6112

You can specify a mnemonic, also known as a keyboard accelerator, by putting an ampersand in front of the letter to be used as the accelerator in the Title field.

VSTip6112a

Now, on the Tools menu, you can simply press n to launch Notepad.

VSTip6112b

If there's a mnemonic conflict, the focus cycles among the commands that share that mnemonic. Then you press Enter at the appropriate command to execute the command. It is ideal to have no conflicts.
Happy Programming! =)
Posted by Nils-Holger at 1:26 PM with 460 comments.

Monday, January 21, 2013

Tip 6.11: You can add your own external tools to the list

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


For this tip, let's add Notepad as an external tool.
Go to the Tools–External Tools dialog box, and you'll see the Add button. Click Add to create a [New Tools 1] placeholder. Rename the title by typing Notepad. For the Command edit box, use the name of the actual executable. You should be able to just type notepad.exe, depending on your environment variables.

VSTip6111

This is the minimum amount of information you need to include to make an external tool work. But let's go a little further by exploring the optional arguments. For Arguments, you can type the name of a file, either an existing file if you want Notepad to open it or the name of a file if you want Notepad to create. For Initial Directory, you can type the file path, either the path where the file exists or where you want Notepad to create it. And of course, you'll see Notepad now in the Tools menu.

VSTip6111a

We'll explore more of the arguments and other options in the upcoming tips.
Happy Programming! =)
Posted by Nils-Holger at 1:53 PM with 497 comments.

Sunday, January 20, 2013

Tip 6.10: You can run external tools from the IDE

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


Sara Aside

Okay she has to admit, she's not the local expert in External Tools. She can talk about the functionality all day long, but nothing is better than real-world examples. When she blogged about this tip, she asked blog readers to leave comments about how they use this feature. You can see their comments at http://blogs.msdn.com/b/saraford/archive/2008/04/24/did-you-know-you-can-run-external-tools-within-visual-studio-201.aspx.

Let's start with the basics. Go to Tools–External Tools to bring up the External Tools dialog box. You'll notice a set of built-in tools ready to go for you.

VSTip6110

This list of tools under Menu Contents maps directly to the list presented on the Tools menu, as shown here:

VSTip6110a

Sara Aside

The first time she made this connection she was totally taken aback. She probably saw this list of tools for years, but she never knew it came directly from the External Tools dialog box.


Happy Programming! =)
Posted by Nils-Holger at 12:20 PM with 1247 comments.

Saturday, January 19, 2013

Tip 6.9: You can use team settings to keep Visual Studio settings on different machines in sync

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


Under Tools–Options–Environment–Import And Export Settings, you'll see an option called Use Team Settings File. This option enables you to let all the members of your team use the same baseline settings. You can provide a .vssettings file (by creating these customizations on your machine and then using Tools–Import And Export Settings–Export to create the file). Then put the .vssettings file on a Universal Naming Convention (UNC) share. Next, you check the Use Team Settings File check box, pointing it at this file.

VSTip6900

So, what happens now? Whenever Visual Studio launches, it'll check the time stamp of the .vssettings file, and if there has been an update, Visual Studio will reapply all the settings from the .vssettings file. But be aware, if you have any custom changes, they will be overwritten when Visual Studio detects the new team settings file. She thinks that this works really well in a scenario where there's a single developer who works on multiple computers, because any tweaks the developer makes on one machine will be carried over to the next machine.
Happy Programming! =)
Posted by Nils-Holger at 12:50 PM with 438 comments.

Friday, January 18, 2013

Tip 6.8: You can copy the full file path from the final wizard page when exporting settings

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


This tip is more like a "tip" than her usual "micro functionality" daily tips. After you export, the final page of the wizard shows you the full file path. This page is just a read-only edit box that can take focus. In other words, you can put your cursor in it and copy the full file path.

VSTip6800

After you export your settings, you may want to open the file and see what's there, in case you want to make any tweaks. Otherwise, you'll have to open the Import And Export Settings dialog box and go through the wizard to guess where you exported that file to.
Happy Programming! =)
Posted by Nils-Holger at 12:47 PM with 652 comments.

Thursday, January 17, 2013

Tip 6.7: How Visual Studio automatically saves all your current settings every time you close it

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


On the Tools–Options–Environment–Import And Export Settings (yes, the Tools–Import And Export Settings dialog box has its own Tools Options page), you'll find the option that lets you choose where to store your current settings. Note that you don't get to opt out of this. Prior to Visual Studio 2005, settings categories were saved in separate files in %appdata%, such as a file for all your toolbox customizations, your window layouts, your keyboard shortcut bindings, and your command bar changes. Starting in Visual Studio 2005, those settings are now stored in a centralized file called the CurrentSettings.vssettings file by default.

VSTip6700

Every time Visual Studio shuts down, it writes to this file location to keep your current settings saved. If you ever make a change that you need to quickly back out of, you can always go to Tools–Import And Export Settings–Import and choose the CurrentSettings.vssettings file, located in the My Settings folder.



Happy Programming! =)
Posted by Nils-Holger at 2:01 PM with 468 comments.

Wednesday, January 16, 2013

Tip 6.6: You can save your current settings prior to doing an Import or Reset

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


Sara Aside

Sometimes "Tip of the Day" isn't about stating the obvious; it's about stating the nonobvious. A lot of times, there's functionality that seems trivial on the surface, but one-off things occur at a deeper level, as seen in Tip 6.5. Fortunately, this tip is trivial. No hidden operations going on under the UI that she has to explain.


Whenever you do a destructive operation via Tools–Import And Export Settings, such as importing or resetting your settings, Visual Studio prompts you to save your current settings prior to continuing. This operation is the same as doing a full export (that is, going to the Export page and checking everything to export to a file).

VSTip6600

The one thing she'll call out is that the Store My Settings File In This Directory combo box will remember any location where you've exported a file to, because you may wish to save your current settings there again in the future.

Happy Programming! =)
Posted by Nils-Holger at 1:58 PM with 1696 comments.

Tuesday, January 15, 2013

Tip 6.5: What's the difference between resetting settings and importing settings?

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


Whenever she demos Tools–Import And Export Settings, she's usually asked to explain the difference between the Import feature and the Reset feature. From an end-user perspective, importing everything in that particular settings file provides the same functionally as a reset.

VSTip6500

But of course, there's more going on under the UI surface. Whenever you do a reset, the IDE stores the path of the file you picked to reset to in the registry. There are some shortcuts within the IDE to quickly reset those settings. Following are a couple of the most common of these quick reset options. First, on the Tools–Options–Environment–Fonts And Colors page, you'll see the Use Defaults option. This option resets your fonts and colors using the settings file you last reset to.

VSTip6500a

Second, on the Window menu, there's the command Reset Window Layout. This command resets your window layouts (that is, all your tool windows in all four window layout states) using the settings file you last reset to.

VSTip6500b

But ... What if you attempt to reset using a file you last reset to that didn't contain this particular category? For example, let's say you last reset to your own settings file and it didn't contain the Window Layouts category. Then she believes Visual Studio uses its factory defaults (the legacy settings that were built in for Visual Studio .NET 2003, the version before the Import And Export Settings feature was built) whenever you do Windows–Reset Window Layout. She recalls during one of the many Profiles feature design meetings the term schizophrenia being used to describe the possible states Visual Studio could end up in. =D
Happy Programming! =)
Posted by Nils-Holger at 12:47 PM with 442 comments.

Monday, January 14, 2013

Tip 6.4: You can add your own files to the Import And Export Settings–Reset page list

"Visual Studio Tips, 251 Ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


If you go to the Reset page on the Tools–Import And Export Settings Wizard, you'll see the list of files you can reset to. These settings files are the ones created by the Visual Studio team. But, let's say that one of the default files has some small option that just annoys you or you want to add your own file to the list, as shown here:

VSTip6400

These files live at \Program Files\Microsoft Visual Studio 10.0\Common7\IDE\Profiles. You'll need administrator rights to access Program Files, so please use this tip at your own risk. In this folder, you can add your own .vssettings files or modify the existing ones. She uses the General Development Settings, but any time she does a reset, the Tools–Customize–Show Shortcut Keys In ScreenTips option becomes unchecked. This option shows you the keyboard shortcut for a toolbar button in the ToolTip, a visual cue she absolutely must have. If you find yourself in a similar situation, where you want to make small tweaks to one of the default settings files provided, you can do the following:
    1. Reset to General Development Settings.
    2. Enable the setting or settings you prefer.
    3. Do a full export (for example, check all options in the Export page), and write over the General Development Settings.
    4. Copy this file over the existing General Development Settings file that lives in \Program Files.
The next time you reset using these settings, you'll see your preferred settings. And in her case, she'll see her keyboard shortcuts in her ToolTips!
Happy Programming! =)
Posted by Nils-Holger at 1:13 PM with 506 comments.

Sunday, January 13, 2013

Tip 6.3: What settings are contained in the New Project Dialog Preferred Language category

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


If you go to Tools–Import And Export Settings–Export Settings, you'll see the list of categories that can be contained in a .vssettings file. The first category she wants to discuss is the New Project Dialog Preferred Language category.

VSTip6300

As noted in the description, it organizes the New Project Dialog folders based on the preferred language. If C# is preferred, all the C# projects are listed at the top of the list and all the others are collected toward the bottom. The General Development Settings use the defaults that have been familiar since the Visual Studio .NET 2002 days, as shown here:

VSTip6300a

Now let's see the dialog box using the Visual C# Development Settings. Note how Visual Basic and Visual C++ fall into the newly created Other Languages node.

VSTip6300b

Happy Programming! =)
Posted by Nils-Holger at 1:49 PM with 436 comments.

Saturday, January 12, 2013

Tip 6.2: How to reset your environment settings via Tools–Import And Export Settings

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


The most popular question she sees about Visual Studio IDE is how to reset the environment settings. Starting in Visual Studio 2005, the IDE prompts you on first launch to pick your development settings. If you need to reset back to what you picked or want to pick previously saved settings or predefined settings, go to Tools–Import And Export Settings to launch the wizard, and choose Reset All Settings.

VSTip6200

On the next page you decide whether you want to save your current settings. If this is your first time using this dialog box or you want to experiment with this feature, or both, definitely choose to save your settings. The default is to save your settings, so go with the default if you are unsure.

VSTip6200a

The following page is much more interesting. You may notice this list looks familiar. It should, because this is the same list from that first launch dialog box that prompts you to pick your preferred environment settings. These files contain default settings for features such as keyboard shortcut bindings, tool window layouts, project template layouts, and many, many more.

VSTip6200b

Choose your IDE settings by clicking Finish. Visual Studio lets you know whether any issues arose with regard to resetting your settings.

VSTip6200c

Happy Programming! =)
Posted by Nils-Holger at 12:44 PM with 436 comments.

Friday, January 11, 2013

Tip 6.1: How to find what development settings you last reset to

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


Maybe you don't remember what you picked during your first launch of Visual Studio or what you last reset to. Under the HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\Profile key, you'll see the LastResetSettingsFile value. As previously mentioned, the code name for this feature was Profiles, hence the word Profile is used as the key. In the following example, you'll notice how she's using the Visual Basic Settings.

VSTip6100

If you haven't reset any settings since launching Visual Studio, this value tells you this is what you picked at first launch.
Happy Programming! =)
Posted by Nils-Holger at 11:24 AM with 448 comments.