Posts tagged 'Project and Solution System'

Thursday, July 10, 2014

Tip 7.14: You can use tracepoints to log PrintF() or Console.WriteLine() info without editing your code

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

Sara Ford's Blog



Right-click in the editor wherever you want to insert a tracepoint, select Breakpoint, and then select Insert Tracepoint.

vstip7140

This brings up the tracepoint dialog box, which gives you some helpful default settings. But for this example, the really helpful default is in the descriptive text for logging the contents of a variable.

vstip7140a

You'll notice that the editor shows a diamond instead of a circle.

vstip7140b

And the tracepoints are logged in the Output window's Debug pane.

vstip7140c

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

Wednesday, July 9, 2014

Tip 7.13: How to have the Solution Explorer always show (or not show) the file currently opened in the editor

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

Sara Ford's Blog



Because the default is to have the Track Active Item In Solution Explorer option enabled in the General Development Settings, a more appropriate tip is one that shows you either how to turn it back on or how to turn it off.

On the Tools–Options–Projects And Solutions–General page, there's the Track Active Item In Solution Explorer check box. When enabled, this option will sync your Solution Explorer with the open document.

VSTip7130

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

Tuesday, July 8, 2014

Tip 7.12: How to hide or show a solution in the Solution Explorer

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

Sara Ford's Blog



Sometimes, you might find yourself in a state where the solution is not shown. For example, some of the default environment settings, like the Visual Basic Development Settings, have this behavior enabled.

VSTip7120

If you find yourself in this state and want the solution back, go to Tools–Options–Projects And Solutions–General and check the Always Show Solution check box.

VSTip7120a

Having said all this, she'll warn you that Visual Studio overrides this setting and always shows the solution if the solution has two or more projects in it.

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

Monday, July 7, 2014

Tip 7.11: You can automatically perform a rename within an entire project when you rename a file in the Solution Explorer

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

Sara Ford's Blog



Let's say you create a new class file called Class1. If you try to rename Class1 in the Solution Explorer, Visual Studio prompts you to decide whether you want to rename all references to this code element in your project.

VSTip7110

But she's more of an IDE tips know-it-all, so the real "Did you know" here is this: Did you know you can disable this prompt and just have Visual Studio automatically do the rename for you?

Go to Tools–Options–Projects And Solutions–General and uncheck the Prompt For Symbolic Renaming When Renaming Files option.

VSTip7110a

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

Sunday, July 6, 2014

Tip 7.10: You can add a solution to a solution

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

Sara Ford's Blog



Today's tip falls into the "You can do what!?" category.
  1. Open your primary solution (the solution you want to add another solution to).
  2. Go to File–Add–Add Existing Project.
  3. Change Files Of Type to Solution Files.
  4. Select the solution file you want to add.


VSTip7100

These steps add the contents of ClassLibrary1.sln to the ConsoleApplication5 solution, as shown here.

VSTip7100a

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

Saturday, July 5, 2014

Tip 7.9: There is type-ahead selection support in the Solution Explorer

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

Sara Ford's Blog



Sara Aside

She has been coming up with little songs to keep sane as she posts a daily tip for Visual Studio. She has people swear that they'll catch her on tape singing these one day. One of them is sung to the tune of the Dunkin' Donuts jingle of "Gotta make the donuts" which is "Gotta do tip of the day." Another one she's trying to perfect is sung to the tune of Phil Collins's "Come Dance into the Light" with "It's the simple things in life!" Sad, but true.


She thinks this tip is really cool. She didn't know this one until a coworker showed her, and this was after five years of working on the Visual Studio team.

The Solution Explorer supports type-ahead selection, so wherever you are in the tree view, just start typing the full name of your file and the focus will jump to that match, whether a partial match or a full file name match.

VSTip790

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

Friday, July 4, 2014

Tip 7.8: How to show the Miscellaneous Files project in the Solution Explorer

"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–Documents page, you'll find the Show Miscellaneous Files In Solution Explorer option.

VSTip780

She finds this feature very useful when she's constantly looking at the same files that live outside her current solution. For example, when writing test cases, she would have the actual test case code as its own solution and just reference the test library DLLs. When stepping through the test library, these files get collected under the Miscellaneous Files project. Yes, Miscellaneous Files is actually a project.

VSTip780a

When you reopen the solution, the various miscellaneous files will tag along, just how you left them, provided you have the subsequent option X Items Saved In The Miscellaneous Files Project set to something greater than 0.

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

Thursday, July 3, 2014

Tip 7.7: How to use Simplified Build Configurations

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

Sara Ford's Blog



Sara Aside

The title for this tip as it appears on her blog is "How to pretend the Configuration Manager doesn't exist, besides closing your eyes and saying, 'I don't see you.'" In other words, the Configuration Manager presented an interesting challenge for her as a tester. But Simplified Build Configurations really took it to a new level.


If you have never touched the Debug or Release configurations or have never heard of the Configuration Manager, you might want to try this tip.

Under Tools–Options–Projects And Solutions, you'll see the Show Advanced Build Configurations option. Unchecking this option does quite a few things behind the scenes, but first, she'll briefly describe the Show Advanced Build Configurations option.

VSTip770

By default, Visual Studio comes with two build configurations: Debug and Release. You are free to create your own build configurations via the Configuration Manager. Check out some of her old blog posts on how the Configuration Manager works, if you want to create your own custom build configurations: http://blogs.msdn.com/b/saraford/archive/2005/08/16/452423.aspx and http://blogs.msdn.com/b/saraford/archive/2005/08/18/453346.aspx.

If you are using a custom build configuration and you uncheck the Show Advanced Build Configuration check box, Visual Studio will pretend you still have it checked, enabling you to still open the Configuration Manager.

VSTip770a

When you are working in Simplified Build Configuration mode, the following happens behind the scenes:
  • F5 (Debug.Start) runs under the debugger in the Debug configuration. This means that the binaries will be produced in a Debug folder in the output file path.
  • Ctrl+F5 (Debug.StartWithoutDebugging) runs (with no debugger) in Release configuration. This means the binaries are produced in a Release folder in the output file path.
If you change the Build output path (for example, bin\myRelease) and use Debug. StartWithoutDebugging (Ctrl+F5), Visual Studio builds the release in the myRelease folder. But if you press F5, Visual Studio still puts it in the Debug folder.

From a UI perspective, Visual Studio hides all access points to the Configuration Manager when in Simplified Build Configuration. For example, the Configuration (Release or Debug) and Platform (Any CPU, and so forth) options disabled on the standard toolbar.

VSTip770b

Additionally, the Configuration Manager command disappears on the Solution Explorer context menu, and Configuration and Platform disappear from the Project Properties–Debug page.

And that's more than she ever wanted to type about Simplified Build Configurations, and probably more than you ever wanted to know, but at least now you understand what that little option does. =)

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

Wednesday, July 2, 2014

Tip 7.6: How to hide or show the Project Location Is Not Trusted message box

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

Sara Ford's Blog



When you attempt to open a project hosted on a Universal Naming Convention (UNC) share (for example, \\server\folder), you'll get the following warning message box.

vstip760

If you want to see this message again, but previously you checked the Do Not Show This Message Again check box, you can go to Tools–Options–Projects And Solutions–General and check the Warn User When The Project Location Is Not Trusted check box.

VSTip760a

For more information on why UNC shares are not trusted or what to do about it, here's a pointer to the documentation: http://msdn.microsoft.com/en-us/library/bs2bkwxc.aspx.

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

Tuesday, July 1, 2014

Tip 7.5: You can create temp or "throw away" projects

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

Sara Ford's Blog



If you need to create small projects to try things out or you're not sure how you want to set up things before you save, there's an option for this.

Go to Tools–Options–Projects And Solutions–General, and uncheck the Save New Projects When Created check box.

VSTip750

When this option is unchecked, the Location edit box and several others will be gone from the New Project dialog box.

VSTip750a

This tip is helpful to know in case you, like several readers who have contacted her, accidentally find yourself missing a few edit boxes.

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

Monday, June 30, 2014

Tip 7.4: You can use solution folders to hide projects

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

Sara Ford's Blog



In the Solution Explorer, you can group projects inside of solution folders to improve the manageability of solutions that contain a large number of projects.

With the focus on the Solution node in the Solution Explorer, the Add New Solution Folder button becomes available. Now you can drag projects into this solution folder, as shown next.

VSTip740

But let's actually hide the project. Right-click your newly created solution folder and choose Hide Folder. Now the project is hidden, and a new icon appears to unhide the projects. And yes, you can still build successfully in this state.

VSTip740a

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

Sunday, June 29, 2014

Tip 7.3: You can toggle between small icons and large icons in the New Project dialog box

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

Sara Ford's Blog



Sara Aside

It is amazing how many times she pulled up the New Project dialog box in her lifetime and never noticed the Small/Large icon buttons in the upper-right corner.


Okay, be honest, how long have you been using Visual Studio and are just now noticing those icons for the first time? =) She had been on the Visual Studio team for an entire year before someone pointed them out to her. You learn something new every day.

Here's the New Project dialog box using small icons.



And here's the New Project dialog box using large icons.



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

Saturday, June 28, 2014

Tip 7.2: How to change the default new-project location

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

Sara Ford's Blog

In the New Project dialog box, you can change the default new-project location.

VSTip720

The option to do so lives in Tools–Options–Projects And Solutions–General.

VSTip720a

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

Friday, June 27, 2014

Tip 7.1: How Visual Studio supports multitargeting of the .NET Framework

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

Sara Ford's Blog



Sara Aside

This was the tip of the day for the official Visual Studio 2008 launch. She figured she needed to pick something huge about Visual Studio 2008 to talk about on this day.


A popular new feature for Visual Studio 2008 is the ability to multitarget the .NET Framework. This means that you can use the latest version of the IDE but still be able to target the .NET Framework 2.0 (or .NET Framework 3.0) as needed.

Scott Guthrie has an excellent write-up on multitargeting support on his blog at http://weblogs.asp.net/scottgu/archive/2007/06/20/vs-2008-multi-targeting-support.aspx.

Because Scott did his write-up in C#, she'll take a picture using Visual Basic. And apparently Scott knows about Tip 7.3. =)

VSTip710

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

Tuesday, October 29, 2013

Tip 7.13: How to have the Solution Explorer always show (or not show) the file currently opened in the editor

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

Sara Ford's Blog



Because the default is to have the Track Active Item In Solution Explorer option enabled in the General Development Settings, a more appropriate tip is one that shows you either how to turn it back on or how to turn it off.

On the Tools–Options–Projects And Solutions–General page, there's the Track Active Item In Solution Explorer check box. When enabled, this option will sync your Solution Explorer with the open document.

VSTip7130

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

Monday, October 28, 2013

Tip 7.12: How to hide or show a solution in the Solution Explorer

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

Sara Ford's Blog



Sometimes, you might find yourself in a state where the solution is not shown. For example, some of the default environment settings, like the Visual Basic Development Settings, have this behavior enabled.

VSTip7120

If you find yourself in this state and want the solution back, go to Tools–Options–Projects And Solutions–General and check the Always Show Solution check box.

VSTip7120a

Having said all this, she'll warn you that Visual Studio overrides this setting and always shows the solution if the solution has two or more projects in it.

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

Sunday, October 27, 2013

Tip 7.11: You can automatically perform a rename within an entire project when you rename a file in the Solution Explorer

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

Sara Ford's Blog



Let's say you create a new class file called Class1. If you try to rename Class1 in the Solution Explorer, Visual Studio prompts you to decide whether you want to rename all references to this code element in your project.

VSTip7110

But she's more of an IDE tips know-it-all, so the real "Did you know" here is this: Did you know you can disable this prompt and just have Visual Studio automatically do the rename for you? Go to Tools–Options–Projects And Solutions–General and uncheck the Prompt For Symbolic Renaming When Renaming Files option.

VSTip7110a

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

Saturday, October 26, 2013

Tip 7.10: You can add a solution to a solution

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

Sara Ford's Blog



Today's tip falls into the "You can do what!?" category.
  1. Open your primary solution (the solution you want to add another solution to).
  2. Go to File–Add–Add Existing Project.
  3. Change Files Of Type to Solution Files.
  4. Select the solution file you want to add.


VSTip7100

These steps add the contents of ClassLibrary1.sln to the ConsoleApplication5 solution, as shown here.

VSTip7100a

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

Friday, October 25, 2013

Tip 7.9: There is type-ahead selection support in the Solution Explorer

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

Sara Ford's Blog



Sara Aside

She has been coming up with little songs to keep sane as she posts a daily tip for Visual Studio. She has people swear that they'll catch her on tape singing these one day. One of them is sung to the tune of the Dunkin' Donuts jingle of "Gotta make the donuts" which is "Gotta do tip of the day." Another one she's trying to perfect is sung to the tune of Phil Collins's "Come Dance into the Light" with "It's the simple things in life!" Sad, but true.


She thinks this tip is really cool. She didn't know this one until a coworker showed her, and this was after five years of working on the Visual Studio team. The Solution Explorer supports type-ahead selection, so wherever you are in the tree view, just start typing the full name of your file and the focus will jump to that match, whether a partial match or a full file name match.

VSTip790

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

Thursday, October 24, 2013

Tip 7.8: How to show the Miscellaneous Files project in the Solution Explorer

"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–Documents page, you'll find the Show Miscellaneous Files In Solution Explorer option.

VSTip780

She finds this feature very useful when she's constantly looking at the same files that live outside her current solution. For example, when writing test cases, she would have the actual test case code as its own solution and just reference the test library DLLs. When stepping through the test library, these files get collected under the Miscellaneous Files project. Yes, Miscellaneous Files is actually a project.

VSTip780a

When you reopen the solution, the various miscellaneous files will tag along, just how you left them, provided you have the subsequent option X Items Saved In The Miscellaneous Files Project set to something greater than 0.

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

Wednesday, October 23, 2013

Tip 7.7: How to use Simplified Build Configurations

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

Sara Ford's Blog



Sara Aside

The title for this tip as it appears on her blog is "How to pretend the Configuration Manager doesn't exist, besides closing your eyes and saying, 'I don't see you.'" In other words, the Configuration Manager presented an interesting challenge for her as a tester. But Simplified Build Configurations really took it to a new level.


If you have never touched the Debug or Release configurations or have never heard of the Configuration Manager, you might want to try this tip. Under Tools–Options–Projects And Solutions, you'll see the Show Advanced Build Configurations option. Unchecking this option does quite a few things behind the scenes, but first, she'll briefly describe the Show Advanced Build Configurations option.

VSTip770

By default, Visual Studio comes with two build configurations: Debug and Release. You are free to create your own build configurations via the Configuration Manager. Check out some of her old blog posts on how the Configuration Manager works, if you want to create your own custom build configurations: http://blogs.msdn.com/b/saraford/archive/2005/08/16/452423.aspx and http://blogs.msdn.com/b/saraford/archive/2005/08/18/453346.aspx. If you are using a custom build configuration and you uncheck the Show Advanced Build Configuration check box, Visual Studio will pretend you still have it checked, enabling you to still open the Configuration Manager.

VSTip770a

When you are working in Simplified Build Configuration mode, the following happens behind the scenes:
  • F5 (Debug.Start) runs under the debugger in the Debug configuration. This means that the binaries will be produced in a Debug folder in the output file path.
  • Ctrl+F5 (Debug.StartWithoutDebugging) runs (with no debugger) in Release configuration. This means the binaries are produced in a Release folder in the output file path.
If you change the Build output path (for example, bin\myRelease) and use Debug. StartWithoutDebugging (Ctrl+F5), Visual Studio builds the release in the myRelease folder. But if you press F5, Visual Studio still puts it in the Debug folder. From a UI perspective, Visual Studio hides all access points to the Configuration Manager when in Simplified Build Configuration. For example, the Configuration (Release or Debug) and Platform (Any CPU, and so forth) options disabled on the standard toolbar.

VSTip770b

Additionally, the Configuration Manager command disappears on the Solution Explorer context menu, and Configuration and Platform disappear from the Project Properties–Debug page. And that's more than she ever wanted to type about Simplified Build Configurations, and probably more than you ever wanted to know, but at least now you understand what that little option does. =)

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

Tuesday, October 22, 2013

Tip 7.6: How to hide or show the Project Location Is Not Trusted message box

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

Sara Ford's Blog



When you attempt to open a project hosted on a Universal Naming Convention (UNC) share (for example, \\server\folder), you'll get the following warning message box.

vstip760

If you want to see this message again, but previously you checked the Do Not Show This Message Again check box, you can go to Tools–Options–Projects And Solutions–General and check the Warn User When The Project Location Is Not Trusted check box.

VSTip760a

For more information on why UNC shares are not trusted or what to do about it, here's a pointer to the documentation: http://msdn.microsoft.com/en-us/library/bs2bkwxc.aspx.

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

Monday, October 21, 2013

Tip 7.5: You can create temp or "throw away" projects

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

Sara Ford's Blog



If you need to create small projects to try things out or you're not sure how you want to set up things before you save, there's an option for this. Go to Tools–Options–Projects And Solutions–General, and uncheck the Save New Projects When Created check box.

VSTip750

When this option is unchecked, the Location edit box and several others will be gone from the New Project dialog box.

VSTip750a

This tip is helpful to know in case you, like several readers who have contacted her, accidentally find yourself missing a few edit boxes.

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

Sunday, October 20, 2013

Tip 7.4: You can use solution folders to hide projects

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

Sara Ford's Blog



In the Solution Explorer, you can group projects inside of solution folders to improve the manageability of solutions that contain a large number of projects. With the focus on the Solution node in the Solution Explorer, the Add New Solution Folder button becomes available. Now you can drag projects into this solution folder, as shown next.

VSTip740

But let's actually hide the project. Right-click your newly created solution folder and choose Hide Folder. Now the project is hidden, and a new icon appears to unhide the projects. And yes, you can still build successfully in this state.

VSTip740a

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

Saturday, October 19, 2013

Tip 7.3: You can toggle between small icons and large icons in the New Project dialog box

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

Sara Ford's Blog



Sara Aside

It is amazing how many times she pulled up the New Project dialog box in her lifetime and never noticed the Small/Large icon buttons in the upper-right corner.


Okay, be honest, how long have you been using Visual Studio and are just now noticing those icons for the first time? =) She had been on the Visual Studio team for an entire year before someone pointed them out to her. You learn something new every day. Here's the New Project dialog box using small icons.



And here's the New Project dialog box using large icons.



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

Friday, October 18, 2013

Tip 7.2: How to change the default new-project location

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

Sara Ford's Blog



In the New Project dialog box, you can change the default new-project location.

VSTip720

The option to do so lives in Tools–Options–Projects And Solutions–General.

VSTip720a

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

Thursday, October 17, 2013

Tip 7.1: How Visual Studio 2008 supports multitargeting of the .NET Framework

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

Sara Ford's Blog



Sara Aside

This was the tip of the day for the official Visual Studio 2008 launch. She figured she needed to pick something huge about Visual Studio 2008 to talk about on this day.


A popular new feature for Visual Studio 2008 is the ability to multitarget the .NET Framework. This means that you can use the latest version of the IDE but still be able to target the .NET Framework 2.0 (or .NET Framework 3.0) as needed. Scott Guthrie has an excellent write-up on multitargeting support on his blog at http://weblogs.asp.net/scottgu/archive/2007/06/20/vs-2008-multi-targeting-support.aspx. Because Scott did his write-up in C#, she'll take a picture using Visual Basic. And apparently Scott knows about Tip 7.3. =)

VSTip710

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

Wednesday, February 13, 2013

Tip 7.13: How to have the Solution Explorer always show (or not show) the file currently opened in the editor

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

Sara Ford's Blog



Because the default is to have the Track Active Item In Solution Explorer option enabled in the General Development Settings, a more appropriate tip is one that shows you either how to turn it back on or how to turn it off. On the Tools–Options–Projects And Solutions–General page, there's the Track Active Item In Solution Explorer check box. When enabled, this option will sync your Solution Explorer with the open document.

VSTip7130

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

Tuesday, February 12, 2013

Tip 7.12: How to hide or show a solution in the Solution Explorer

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

Sara Ford's Blog



Sometimes, you might find yourself in a state where the solution is not shown. For example, some of the default environment settings, like the Visual Basic Development Settings, have this behavior enabled.

VSTip7120

If you find yourself in this state and want the solution back, go to Tools–Options–Projects And Solutions–General and check the Always Show Solution check box.

VSTip7120a

Having said all this, she'll warn you that Visual Studio overrides this setting and always shows the solution if the solution has two or more projects in it.

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

Monday, February 11, 2013

Tip 7.11: You can automatically perform a rename within an entire project when you rename a file in the Solution Explorer

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

Sara Ford's Blog



Let's say you create a new class file called Class1. If you try to rename Class1 in the Solution Explorer, Visual Studio prompts you to decide whether you want to rename all references to this code element in your project.

VSTip7110

But she's more of an IDE tips know-it-all, so the real "Did you know" here is this: Did you know you can disable this prompt and just have Visual Studio automatically do the rename for you? Go to Tools–Options–Projects And Solutions–General and uncheck the Prompt For Symbolic Renaming When Renaming Files option.

VSTip7110a

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

Sunday, February 10, 2013

Tip 7.10: You can add a solution to a solution

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

Sara Ford's Blog



Today's tip falls into the "You can do what!?" category.
  1. Open your primary solution (the solution you want to add another solution to).
  2. Go to File–Add–Add Existing Project.
  3. Change Files Of Type to Solution Files.
  4. Select the solution file you want to add.


VSTip7100

These steps add the contents of ClassLibrary1.sln to the ConsoleApplication5 solution, as shown here.

VSTip7100a

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

Saturday, February 9, 2013

Tip 7.9: There is type-ahead selection support in the Solution Explorer

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

Sara Ford's Blog



Sara Aside

She has been coming up with little songs to keep sane as she posts a daily tip for Visual Studio. She has people swear that they'll catch her on tape singing these one day. One of them is sung to the tune of the Dunkin' Donuts jingle of "Gotta make the donuts" which is "Gotta do tip of the day." Another one she's trying to perfect is sung to the tune of Phil Collins's "Come Dance into the Light" with "It's the simple things in life!" Sad, but true.


She thinks this tip is really cool. She didn't know this one until a coworker showed her, and this was after five years of working on the Visual Studio team. The Solution Explorer supports type-ahead selection, so wherever you are in the tree view, just start typing the full name of your file and the focus will jump to that match, whether a partial match or a full file name match.

VSTip790

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

Friday, February 8, 2013

Tip 7.8: How to show the Miscellaneous Files project in the Solution Explorer

"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–Documents page, you'll find the Show Miscellaneous Files In Solution Explorer option.

VSTip780

She finds this feature very useful when she's constantly looking at the same files that live outside her current solution. For example, when writing test cases, she would have the actual test case code as its own solution and just reference the test library DLLs. When stepping through the test library, these files get collected under the Miscellaneous Files project. Yes, Miscellaneous Files is actually a project.

VSTip780a

When you reopen the solution, the various miscellaneous files will tag along, just how you left them, provided you have the subsequent option X Items Saved In The Miscellaneous Files Project set to something greater than 0.

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

Thursday, February 7, 2013

Tip 7.7: How to use Simplified Build Configurations

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

Sara Ford's Blog



Sara Aside

The title for this tip as it appears on her blog is "How to pretend the Configuration Manager doesn't exist, besides closing your eyes and saying, 'I don't see you.'" In other words, the Configuration Manager presented an interesting challenge for her as a tester. But Simplified Build Configurations really took it to a new level.


If you have never touched the Debug or Release configurations or have never heard of the Configuration Manager, you might want to try this tip. Under Tools–Options–Projects And Solutions, you'll see the Show Advanced Build Configurations option. Unchecking this option does quite a few things behind the scenes, but first, she'll briefly describe the Show Advanced Build Configurations option.

VSTip770

By default, Visual Studio comes with two build configurations: Debug and Release. You are free to create your own build configurations via the Configuration Manager. Check out some of her old blog posts on how the Configuration Manager works, if you want to create your own custom build configurations: http://blogs.msdn.com/b/saraford/archive/2005/08/16/452423.aspx and http://blogs.msdn.com/b/saraford/archive/2005/08/18/453346.aspx. If you are using a custom build configuration and you uncheck the Show Advanced Build Configuration check box, Visual Studio will pretend you still have it checked, enabling you to still open the Configuration Manager.

VSTip770a

When you are working in Simplified Build Configuration mode, the following happens behind the scenes:
  • F5 (Debug.Start) runs under the debugger in the Debug configuration. This means that the binaries will be produced in a Debug folder in the output file path.
  • Ctrl+F5 (Debug.StartWithoutDebugging) runs (with no debugger) in Release configuration. This means the binaries are produced in a Release folder in the output file path.
If you change the Build output path (for example, bin\myRelease) and use Debug. StartWithoutDebugging (Ctrl+F5), Visual Studio builds the release in the myRelease folder. But if you press F5, Visual Studio still puts it in the Debug folder. From a UI perspective, Visual Studio hides all access points to the Configuration Manager when in Simplified Build Configuration. For example, the Configuration (Release or Debug) and Platform (Any CPU, and so forth) options disabled on the standard toolbar.

VSTip770b

Additionally, the Configuration Manager command disappears on the Solution Explorer context menu, and Configuration and Platform disappear from the Project Properties–Debug page. And that's more than she ever wanted to type about Simplified Build Configurations, and probably more than you ever wanted to know, but at least now you understand what that little option does. =)

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

Wednesday, February 6, 2013

Tip 7.6: How to hide or show the Project Location Is Not Trusted message box

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

Sara Ford's Blog



When you attempt to open a project hosted on a Universal Naming Convention (UNC) share (for example, \\server\folder), you'll get the following warning message box.

vstip760

If you want to see this message again, but previously you checked the Do Not Show This Message Again check box, you can go to Tools–Options–Projects And Solutions–General and check the Warn User When The Project Location Is Not Trusted check box.

VSTip760a

For more information on why UNC shares are not trusted or what to do about it, here's a pointer to the documentation: http://msdn.microsoft.com/en-us/library/bs2bkwxc.aspx.

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

Tuesday, February 5, 2013

Tip 7.5: You can create temp or "throw away" projects

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

Sara Ford's Blog



If you need to create small projects to try things out or you're not sure how you want to set up things before you save, there's an option for this. Go to Tools–Options–Projects And Solutions–General, and uncheck the Save New Projects When Created check box.

VSTip750

When this option is unchecked, the Location edit box and several others will be gone from the New Project dialog box.

VSTip750a

This tip is helpful to know in case you, like several readers who have contacted her, accidentally find yourself missing a few edit boxes.

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

Monday, February 4, 2013

Tip 7.4: You can use solution folders to hide projects

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

Sara Ford's Blog



In the Solution Explorer, you can group projects inside of solution folders to improve the manageability of solutions that contain a large number of projects. With the focus on the Solution node in the Solution Explorer, the Add New Solution Folder button becomes available. Now you can drag projects into this solution folder, as shown next.

VSTip740

But let's actually hide the project. Right-click your newly created solution folder and choose Hide Folder. Now the project is hidden, and a new icon appears to unhide the projects. And yes, you can still build successfully in this state.

VSTip740a

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

Sunday, February 3, 2013

Tip 7.3: You can toggle between small icons and large icons in the New Project dialog box

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

Sara Ford's Blog



Sara Aside

It is amazing how many times she has pulled up the New Project dialog box in her lifetime and never noticed the Small/Large icon buttons in the upper-right corner.


Okay, be honest, how long have you been using Visual Studio and are just now noticing those icons for the first time? =) She had been on the Visual Studio team for an entire year before someone pointed them out to her. You learn something new every day. Here's the New Project dialog box using small icons.

VSTip730

And here's the New Project dialog box using large icons.

VSTip730a

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

Saturday, February 2, 2013

Tip 7.2: How to change the default new-project location

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

Sara Ford's Blog



In the New Project dialog box, you can change the default new-project location.

VSTip720

The option to do so lives in Tools–Options–Projects And Solutions–General.

VSTip720a

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

Friday, February 1, 2013

Tip 7.1: How Visual Studio 2008 supports multitargeting of the .NET Framework

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

Sara Ford's Blog



Sara Aside

This was the tip of the day for the official Visual Studio 2008 launch. She figured she needed to pick something huge about Visual Studio 2008 to talk about on this day.


A popular new feature for Visual Studio 2008 is the ability to multitarget the .NET Framework. This means that you can use the latest version of the IDE but still be able to target the .NET Framework 2.0 (or .NET Framework 3.0) as needed. Scott Guthrie has an excellent write-up on multitargeting support on his blog at http://weblogs.asp.net/scottgu/archive/2007/06/20/vs-2008-multi-targeting-support.aspx. Because Scott did his write-up in C#, she'll take a picture using Visual Basic. And apparently Scott knows about Tip 7.3. =)

VSTip710

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