<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Visual Studio Hacks &#187; Articles</title>
	<atom:link href="http://visualstudiohacks.com/category/articles/feed/" rel="self" type="application/rss+xml" />
	<link>http://visualstudiohacks.com</link>
	<description></description>
	<lastBuildDate>Mon, 23 Nov 2009 23:09:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Visual Studio .NET Platform Target Explained</title>
		<link>http://visualstudiohacks.com/articles/visual-studio-net-platform-target-explained/</link>
		<comments>http://visualstudiohacks.com/articles/visual-studio-net-platform-target-explained/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 07:21:02 +0000</pubDate>
		<dc:creator>dstokes</dc:creator>
				<category><![CDATA[Articles]]></category>

		<guid isPermaLink="false">http://vsh.infozerk.net/?p=120</guid>
		<description><![CDATA[The Platform Target is an often overlooked option in the build configuration for Visual Studio 2005 and 2008 projects.&#160; For C# projects, you will find this option on the Project Properties dialog under the build [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>The Platform Target is an often overlooked option in the build configuration for Visual Studio 2005 and 2008 projects.&nbsp; For C# projects, you will find this option on the Project Properties dialog under the build tab.&nbsp; For VB.net projects, the setting is found on the Advanced Compiler Settings dialog which is made available via the Advanced Compile Options button on the Compile tab of the Project Properties.&nbsp; The list of available options are:</p>
<ol>
<li>Any CPU
<li>x86
<li>x64
<li>Itanium</li>
</ol>
<p>The meaning of these options is often misunderstood.&nbsp; Based on their names, one might think that the compiler will generate code differently based upon the setting.&nbsp; However, the C# and VB.net compilers only generate IL code that is taken to native code by the CLR at runtime using the just-in-time compiler (unless <a href="http://msdn.microsoft.com/en-us/library/6t9t5wcf(VS.80).aspx">ngen</a> is used but that is another discussion).&nbsp; The fact is that this setting actually does not affect the build of the assembly in any way except to set the platform status information on the assembly&#8217;s CLR header.&nbsp; In other words, the Platform Target setting is meant to communicate the platform that the developer intends to be compatible with.</p>
<p>The default setting, Any CPU, means that the assembly will run natively on the CPU is it currently running on.&nbsp; Meaning, it will run as 64-bit on a 64-bit machine and 32-bit on a 32-bit machine.&nbsp; If the assembly is called from a 64-bit application, it will perform as a 64-bit assembly and so on.</p>
<p>If the project is set to x86, this means the project is intended to run only as a 32-bit process.&nbsp; A 64-bit process will be unable to call into an assembly set as X86.&nbsp; Reasons to set your project as x86 include dependencies upon native DLLs that are only available in 32-bit or making native calls assuming 32-bit .&nbsp; Applications and assemblies marked for x86 can still run on 64-bit Windows.&nbsp; However they run under <a href="http://msdn.microsoft.com/en-us/library/aa384274.aspx">WOW64</a>.&nbsp; Visual Studio itself runs under this emulation mode since it is a 32-bit application.</p>
<p>Setting the project to x64 will specify that the assembly must run under 64-bit Windows.&nbsp; Attempting to run the assembly on 32-bit Windows or call the assembly from a 32-bit process will result in a runtime error.</p>
<p>The final, and likely least common, setting is Itanium.&nbsp; This setting specifies that the assembly will only run on an Itanium processor.&nbsp; The only reason to set your project for Itanium is if it has dependencies on native DLLs compiled specifically for the Itanium processor.</p>
<p>Developers should be aware that simply marking Platform Target of an assembly as Any CPU does not guarantee that it will run on both 32-bit and 64-bit Windows.&nbsp; In fact, since Any CPU is the default setting, there are likely many applications that actually depend upon 32-bit processing but are not marked as such.&nbsp; These assemblies will fail under 64-bit Windows when run from a 64-bit process so it is important to perform testing for your applications before users are migrated to 64-bit.&nbsp; The somewhat increasing popularity of Vista x64 will soon elevate the importance of this type of testing.</p>
<p>Another point to be aware of when attempting to migrate to 64-bit processing for .Net applications is the dependency upon assemblies originally built using Visual Studio 2002 and 2003.&nbsp; All assemblies targeting .Net 1.0 and 1.1 will be 32-bit only (x86) so these assemblies will need to be upgraded to newer versions, if available, or the functionality will need to be replaced in order for the process to execute as 64-bit.</p>
<p>Here are some excellent links on MSDN that should be required reading before migrating a complex project to 64-bit Windows:</p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms241064.aspx">Visual Studio 64-bit Applications</a></p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms973190.aspx">Migrating 32-bit Managed Code to 64-bit</a></p>
]]></content:encoded>
			<wfw:commentRss>http://visualstudiohacks.com/articles/visual-studio-net-platform-target-explained/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Confessions of a Keyboard Junkie</title>
		<link>http://visualstudiohacks.com/general/confessions-of-a-keyboard-junkie/</link>
		<comments>http://visualstudiohacks.com/general/confessions-of-a-keyboard-junkie/#comments</comments>
		<pubDate>Sat, 01 Mar 2008 18:09:00 +0000</pubDate>
		<dc:creator>javery</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://vsh.infozerk.net/?p=18</guid>
		<description><![CDATA[I&#8217;m a keyboard junkie, perhaps a remnant left over from using Vim and Emacs-variants in my early days of programming. I dislike having to move over to the trackball to accomplish something, simply because it [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I&#8217;m a keyboard junkie, perhaps a remnant left over from using Vim and Emacs-variants in my early days of programming. I dislike having to move over to the trackball to accomplish something, simply because it breaks my train of thought and always seems to take too long to get the cursor positioned where I want it, then use guestures/motions to get a task accomplished.</p>
<p>Keyboard shortcuts are a great productivity boost to me, and thankfully Visual Studio has a plethora of them available. Furthermore, you can assign shortcuts to just about any command you could possibly think of.</p>
<p>Here are some of my favorite keyboard actions, broken into various sections.</p>
<p>NAVIGATION</p>
<table border="0">
<tbody>
<tr>
<td>Ctrl + &#8211; (hyphen)</td>
<td>Cycle through previous cursor positions</td>
</tr>
<tr>
<td>Ctrl + Shift + -</td>
<td>Cycle in the opposite direction</td>
</tr>
</tbody>
</table>
<p>Cycling through cursor positions is a great way to save time moving between areas you?re working on. Note that this will actually move you between files you?ve been working in, too.</p>
<table border="0">
<tbody>
<tr>
<td>Ctrl + ]</td>
<td>Bounce to matching brace, comment, region or quote, depending on the what?s currently at the cursor.</td>
</tr>
</tbody>
</table>
<p>This is handy way to jump between the opening and closing marks of a region, quote, or brace set. It?s also a handy way to check if you?ve got your braces properly matched. Another way of doing that would be to format the entire file with Ctrl-A, Ctrl-K, Ctrl-F, but that?s more keystrokes.</p>
<p>BOOKMARKS (Note these are chord key combinations)</p>
<table border="0">
<tbody>
<tr>
<td>Ctrl + K, Ctrl + K</td>
<td>Create a bookmark</td>
</tr>
<tr>
<td>Ctrl + K, Ctrl + N</td>
<td>Bounce to next bookmark</td>
</tr>
<tr>
<td>Ctrl + K, Ctrl + P</td>
<td>Bounce to previous bookmark</td>
</tr>
<tr>
<td>Ctrl + K, Ctrl + L</td>
<td>Clear all bookmarks</td>
</tr>
</tbody>
</table>
<p>Bookmarks work much like the cursor marks discussed above, but you?re able to control exactly where you want to bounce back and forth between.</p>
<p>FAVORITE NAV TRICK FROM VIM DAYS</p>
<table border="0">
<tbody>
<tr>
<td>Ctrl + G</td>
<td>Go to line number (turn on line numbering via Tools -&gt; Options -&gt; Text Editor -&gt; Select your editor -&gt; Display -&gt; Line Numbers)</td>
</tr>
</tbody>
</table>
<p>I use this all the time in Vim since it&#8217;s a quick way to jump to a spot where you know the line number, even if it&#8217;s just a few lines up on the screen.  Hit Ctrl-G, type in a line number and press Enter instead of reaching for the mouse, or hitting the up arrow a bunch of times.  I use it even when I&#8217;m not certain of the exact line number, but know the general region I want to hit.</p>
<p>OUTLINING</p>
<table border="0">
<tbody>
<tr>
<td>Ctrl + M, Ctrl + M</td>
<td>Collapse or expand the block you?re currently in.</td>
</tr>
<tr>
<td>Ctrl + M, Ctrl + O</td>
<td>Collapse all blocks in the file</td>
</tr>
<tr>
<td>Ctrl + M, Ctrl + L</td>
<td>Expand all blocks in the file</td>
</tr>
<tr>
<td>Ctrl + M, Ctrl + P</td>
<td>Stop outlining mode. (Ctrl+M, Ctrl+O resumes)</td>
</tr>
</tbody>
</table>
<p>I think the Stop Outline Mode is pretty useless, but I love the other commands. I like clearing off extra cruft from the screen, allowing me to focus on what I?m working in at the moment.</p>
<p>CLIPBOARD RING</p>
<table border="0">
<tbody>
<tr>
<td>Ctrl + Shift + V</td>
<td>Cycle through items copied to clipboard</td>
</tr>
</tbody>
</table>
<p>The clipboard ring&#8217;s a terrific tool for doing mass edits.  Move a number of items into the clipboard ring via any Copy or Cut command, then cycle through those items as you&#8217;re pasting away.</p>
<p>OTHER             GOOD ARTICLES</p>
<p><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=fb356669-ac87-4e11-9678-6298cd409483&amp;DisplayLang=en"> Ari Bixhorn&#8217;s MSDN TV</a> episode on his top ten Code Editor Tips and Tricks.</p>
<p><a href="http://www.codeproject.com/tips/VSnetIDETipsAndTricks.asp">SathishVJ&#8217;s article</a> on The Code Project.</p>
]]></content:encoded>
			<wfw:commentRss>http://visualstudiohacks.com/general/confessions-of-a-keyboard-junkie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Optimize Visual Studio for Presentations</title>
		<link>http://visualstudiohacks.com/general/optimize-visual-studio-for-presentations/</link>
		<comments>http://visualstudiohacks.com/general/optimize-visual-studio-for-presentations/#comments</comments>
		<pubDate>Sat, 01 Mar 2008 18:07:00 +0000</pubDate>
		<dc:creator>javery</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://vsh.infozerk.net/?p=17</guid>
		<description><![CDATA[Visual Studio&#8217;s a great development environment, but out of the box it&#8217;s not the greatest thing for displaying code to an audience via an overhead projector. It doesn&#8217;t matter if you&#8217;re giving a presentation to [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Visual Studio&#8217;s a great development environment, but out of the box it&#8217;s not the greatest thing for displaying code to an audience via an overhead projector. It doesn&#8217;t matter if you&#8217;re giving a presentation to a thousand geeks at a conference or walking through a code review with two other members of your development team &#8212; your work isn&#8217;t effective if your audience can&#8217;t see what you&#8217;re talking about.</p>
<p>Visual Studio 2005 offers several great tricks for making presentations more effective. You can change font sizes, rearrange your windows, and toggle toolbars off and on to maximize screen real estate. VS2005 also gives you the ability to easily export and import settings so that you can configure your regular work environment and quickly change to an environment more suitable for presentations. You can also speed up your presentation by taking advantage of the General Toolbox’s ability to store code snippets for quick retrieval. Additionally, several macros and a free tool can make your presentation life much easier when adjusting font sizes or trying to display an obscure part of the screen.</p>
<p>Be sure to save your current IDE settings before tweaking things up for presentations. Saving your settings will allow you to quickly switch between your regular development profile and the settings you’ll configure for presentations.</p>
<p>Many active presenters favor Lucida Console at 14 points for presentations. Lucida Console has been acknowledged as a great font for audience viewing. The new font Consolas from Microsoft’s Longhorn operating system is a mono-spaced typeface with terrific readability. Unfortunately, this font is only available in Windows Vista and it’s against Vista&#8217;s End User License Agreement to copy it to a “downlevel platform” as the folks at Microsoft say. However, Microsoft plans release this font as a separate download for Visual Studio 2005 sometime after VS’s release, so you’ll be able to get Consolas regardless of your platform.</p>
<p>Set your font selections through the Tools -&gt; Options -&gt; Environment -&gt; Fonts &amp; Colors dialog. This dialog allows you to configure fonts for individual windows, or by groups of windows. For example, you could configure only the Watch window, or you could configure all Watch, Locals and Autos Tool windows at once.</p>
<p><img src="/files/media/image/PresentationTips1.gif" alt="" /></p>
<p>Sometimes all the preparation in the world doesn’t quite pan out. Maybe Lucida Console 14 isn’t reading well and you need change the size a notch or two in either direction. Rather than forcing your audience to suffer through you pulling down menus and clicking through dialog boxes, take advantage of macros bundled with VS 2005. Sara Ford, previously a Software Design Tester extraordinaire, created two very useful macros to change font sizes with great ease.</p>
<p>Macros.Samples.Accessability.DecreaseTextEditorFontSize and Macros.Samples.Accessability.IncreaseTextEditorFontSize let you decrease and increase font sizes easily. This is especially easy if you’ve bound them to a keyboard shortcut. Select Tools -&gt; Options from Visual Studio&#8217;s main menu, then select the Keyboard item under the Environment section. Click in the &#8220;Show Comamnds Containing&#8221; box and enter &#8220;fontsize&#8221;. The list of commands will filter down, leaving Ford&#8217;s macros right at the top. Set the &#8220;Use new shortcut in&#8221; to &#8220;Text Editor&#8221;, then select a keystroke to bind them to. I&#8217;ve set mine to Ctrl-Shift-Alt-UpArrow and Ctrl-Shift-Alt-DownArrow since those two aren&#8217;t already in use and they&#8217;re not completely convoluted, messy chords &#8212; and they won&#8217;t get used all that often.</p>
<p><img src="/files/media/image/PresentationTips2.gif" alt="" /></p>
<p>Font readability is also impacted by Microsoft’s ClearType feature, available only in Windows XP. ClearType smoothes out fonts, making them appear less pixilated and more like printed characters. Microsoft’s literature on ClearType says it’s targeted to LCD displays, but your system may benefit from activating it regardless of the display type you have. (Microsoft leaves this option off during installation, another less-than-helpful default setting.)</p>
<p>Turn on ClearType by right-clicking anywhere on the Desktop, then selecting Properties. Select the “Appearance” tab, then click the “Effects” button. Ensure the checkbox “Use the following method to smooth edges of screen fonts” is checked. Pull down the list box and select the “ClearType” option. Close out the dialogs and you’ll notice a tremendous difference if you’re using an LCD screen, and you may notice a significant difference if you’re on a CRT.</p>
<p>Now that you’ve got your fonts configured as you prefer for presentations, save off your settings by again. Now you’ve got both profiles ready for easy use.</p>
<p>Maximizing real estate during a presentation is an important trick too. Make use of the full- screen mode by pressing Shift+Alt+Enter. This hides any open toolboxes, tool windows, and all toolbars, leaving you with just scrollbars at the sides and a menu bar at the top.</p>
<p>One handy use of this is to lock open your Solution Explorer, Server Explorer, or other tool window you’re needing to use. Now you can quickly toggle back and forth between your code and tool windows for opening new examples, navigating a database, etc.</p>
<p>How many presentations have you had to sit through while the presenter spent too much time typing code on a keyboard, correcting various typing mistakes? Typing in code is not the best use of your or your audience&#8217;s time unless you&#8217;re demonstrating Intellisense or some other keystroke-related feature.</p>
<p>Visual Studio 2005 gives you the ability to put code snippets on the toolbox, enabling you to skip manual entry of code. Moving snippets to the toolbox will save you great amounts of time and keep your presentation flowing well. Simply highlight a section of code you&#8217;ll be needing to add during your presentation and drag it over to the general toolbox.</p>
<p><img src="/files/media/image/PresentationTips3.gif" alt="" /></p>
<p>You can also make effective use of Magnifixer, a freeware screen magnifying tool, to ensure your audience can read what you&#8217;re displaying in the IDE. <a href="http://www.blacksunsoftware.com/lensview.html">Grab Magnifixer</a> and install it.</p>
<p>Magnifixer comes in very handy when you’re trying to clearly display a portion of the IDE which won’t allow you to set font sizes, such as the Solution Explorer, menus, etc. Simply bring Magnifixer to the front, resize it as needed, then drive your cursor over the portion of the screen you want to display. You can also magnify menus and context menus by selecting the “Stay on top” option on Magnifixer’s lower status bar.</p>
<p><img src="/files/media/image/PresentationTips4.gif" alt="" /></p>
<p>Gadgets and hacks alone won’t get you through a presentation. You’ll need to practice, practice, and more practice to ensure you’ve got both the content and the tools down pat. Scott Hanselman, chief architect of Corrillian and a well-known speaker, has some <a href="http://www.hanselman.com/blog/content/radiostories/2003/01/22/scottHanselmansTipsForASuccessfulMsftPresentation.html">great presentation tips</a>.  Drew Robbins, Microsoft’s Great Lakes Regional Developer Evangelist, also has <a href="http://geekswithblogs.net/drewby/archive/2005/02/05/22125.aspx">some great tips on his blog</a>.  Tom Peters, not a software guy but a world-renowned speaker on many topics, has great advice at <a href="http://www.tompeters.com/slides/uploaded/PresentationEx052605.ppt">his website.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://visualstudiohacks.com/general/optimize-visual-studio-for-presentations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Customize Your Project Build Process</title>
		<link>http://visualstudiohacks.com/general/customize-your-project-build-process/</link>
		<comments>http://visualstudiohacks.com/general/customize-your-project-build-process/#comments</comments>
		<pubDate>Sat, 01 Mar 2008 18:01:00 +0000</pubDate>
		<dc:creator>javery</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://vsh.infozerk.net/?p=16</guid>
		<description><![CDATA[While the Visual Studio build process is familiar for all .NET developers, not everyone realizes the build customization capabilities that can be accomplished with just a little work. You can easily put together tasks that [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>While the Visual Studio build process is familiar for all .NET developers, not everyone realizes the build customization capabilities that can be accomplished with just a little work. You can easily put together tasks that occur before, after, and even during a build.</p>
<p><em><strong>NOTE:</strong> With the release of Visual Studio 2005, a new build tool—called MSBuild—is used within the Visual Studio environment. This tool provides many build process tasks and is similar to NAnt in capability. For pre- and post build operations for automated builds I would suggest looking at MSBuild tasks rather than the project level pre- and post-build commands.</em></p>
<h6>Pre- and Post-Build Event Commands</h6>
<p>In nonweb projects, you can create pre- and post-build event commands. As their names suggest, these are commands that you can customize to run just prior to or after a build. You can even control whether the post-build event executes at all depending on the outcome of the build. In the previous version of Visual Studio these commands could only be found in C# projects, but Visual Studio 2005 now exposes them for VB.Net as well. For C# projects you can find the settings on their own tab in the Project Properties pages, while for Visual Basic projects they are found via a Build Events button on the Compile tab in the My Project properties window.</p>
<p><img src="/files/media/image/customizingBuilds1.gif" alt="Project build events for C# projects" /></p>
<p>Project build events for C# projects</p>
<p><img src="/files/media/image/customizingBuilds2.gif" alt="Project build events for VB.NET projects." /></p>
<p>Project build events for VB.Net projects Note the build Events button in the bottom right corner of the window.</p>
<p>Just type in the command you want to occur for each event type. You can click on an Edit Event button under each event type to help “build” up your command using a set of tokens or “Macros”. These variables help provide some shortcuts to including pathnames, project output locations, and other information into your event commands. Note that the variables are sensitive to the type of build you are compiling, so if you switch to a release build, the variables referencing the output directory will be correctly pointed at the <code>\bin\release</code> directory (or wherever you have set up the output directory to be).</p>
<p>Macro examples</p>
<table border="1">
<tbody>
<tr>
<td>Name</td>
<td>Description</td>
</tr>
<tr>
<td>$(TargetPath)</td>
<td>The full directory path to the output directory, including the project output filename. Example: <code>c:\CSharpWinFormApp\bin\debug\CSharpWinFormApp.exe</code></td>
</tr>
<tr>
<td>$(TargetDir)</td>
<td>The full directory path to the output directory. Example: <code>c:\CSharpWinFormApp\bin\debug\</code></td>
</tr>
<tr>
<td>$(ProjectDir)</td>
<td>The full directory path to where the project file exists. Example: <code>c:\CSharpWinFormApp\</code></td>
</tr>
</tbody>
</table>
<p>The build event command lines are simply command-line operations that will be executed at the specified time. The commands are saved in the project file and are Targets configured in MSBuild to be used by the build process to execute the commands. Note that Visual Studio 2005 does not copy these commands out into batch files during a build like its predecessor did.</p>
<p>Note that a failing build event will be shown in the build output and listed in the Build Error task list along with any other build errors. A failing pre-build event will cause the build to stop, while a failing post-build event will still mark the build as a failure even if the build of the code succeeded without errors. You can choose to have the post-build event occur every build, only if the build succeeded, or when the project output (the resulting <code>.dll</code> or <code>.exe</code>) actually changes.</p>
<p>A great example of using a custom post-build event is when you have multiple configuration files. Whe n you add an <code>app.config</code> file to your project, it will automatically be copied to the output directory of the project and renamed to match up with the project output file (e.g., <code>CSharpWinFormApp.exe.config</code>), but the IDE will not do the same with other custom configuration files. What if your project had multiple <code>.config</code> files to break up the settings? For example, you have <code>app.config</code> to store application configuration but then you also have an <code>EndUser.config</code> file to store user-specific settings that you didn’t want to mix with the application settings. By default, this configuration file would not be copied to your output directory, and the application would receive an exception if it went looking for the file during execution. To get around this, a custom post-build event can copy the <code>EndUser.config</code> file to the output directory every time a build succeeds.</p>
<p>In the Build Events, choose to run a Post-Build event when a successful build occurs and add a Post-Build event command line of:</p>
<blockquote><p><code>copy "$(ProjectDir)EndUser.config" "$(TargetDir)"</code></p></blockquote>
<p>Note the use of quotes around the variables and commands—the quotes are there because there may be spaces in the file and pathnames. Also, the variables that generate pathnames will append an ending slash automatically. After a successful build of this project the current version of the <code>EndUser.config</code> file in the project directory will be copied to the output directory.</p>
<p>Copying files after a build is just one example of how these build events can be useful. More complex operations can be performed as well. For example, a Windows script or executable could be run when a build completes to kick off a set of test scripts against the newly built output. For automated builds in Visual Studio 2005 these types of operations would be configured as MSBuild Tasks, but within the IDE the pre- and post-build commands can make a life a lot easier.</p>
<h6>Handling Build Events</h6>
<p>Some of the limitations of the custom pre- and post-build command events are that they are available for only nonweb projects and are only project specific. They don’t give you the flexibility to deal with building a multiproject solution or provide a way of handling more complex build outcomes other than a successful build, a failed build, or a changed project output. For more advanced handling of build events, we can turn to the Visual Studio Macro Environment. By using the IDE build events we can configure some operations to occur before, during or after a build no matter what project we are building or what type of project it is.</p>
<p>To hook into the IDE build events, all we need to do is create some simple macros. Open up your Macro IDE (from Tools ? Macros ? Macro IDE or Alt-F11). If you haven’t used the Macro IDE before, the first thing you’ll notice is that it resembles the regular VS.NET IDE, except the Macro IDE is used solely for the creation, editing, and compiling of macros that can be used within your Visual Studio IDE.</p>
<p>Open up the MyMacros project and see if it already contains an EnvironmentEvents module. If it doesn’t, go ahead and copy the one from the Samples directory into your MyMacros project. The code looks like this:</p>
<blockquote>
<pre><code>
Option Strict Off
Option Explicit Off
Imports EnvDTE
Imports EnvDTE80
Imports System.Diagnostics
Public Module EnvironmentEvents
#Region "Automatically generated code, do not modify"
'Automatically generated code, do not modify
'Event Sources Begin
&lt;system.contextstaticattribute()&gt;Public WithEvents
	DTEEvents As EnvDTE.DTEEvents
&lt;system.contextstaticattribute()&gt;Public WithEvents
	DocumentEvents As EnvDTE.DocumentEvents
&lt;system.contextstaticattribute()&gt;Public WithEvents
	WindowEvents As EnvDTE.WindowEvents
&lt;system.contextstaticattribute()&gt;Public WithEvents
	TaskListEvents As EnvDTE.TaskListEvents
&lt;system.contextstaticattribute()&gt;Public WithEvents
	FindEvents As EnvDTE.FindEvents
&lt;system.contextstaticattribute()&gt;Public WithEvents
	OutputWindowEvents As EnvDTE.OutputWindowEvents
&lt;system.contextstaticattribute()&gt;Public WithEvents
	SelectionEvents As EnvDTE.SelectionEvents
&lt;system.contextstaticattribute()&gt;Public WithEvents
	BuildEvents As EnvDTE.BuildEvents
&lt;system.contextstaticattribute()&gt;Public WithEvents
	SolutionEvents As EnvDTE.SolutionEvents
&lt;system.contextstaticattribute()&gt;Public WithEvents
	SolutionItemsEvents As EnvDTE.ProjectItemsEvents
&lt;system.contextstaticattribute()&gt;Public WithEvents
	MiscFilesEvents As EnvDTE.ProjectItemsEvents
&lt;system.contextstaticattribute()&gt;Public WithEvents
	DebuggerEvents As EnvDTE.DebuggerEvents
&lt;system.contextstaticattribute()&gt;Public WithEvents
	ProjectsEvents As EnvDTE.ProjectsEvents
&lt;system.contextstaticattribute()&gt;Public WithEvents
	TextDocumentKeyPressEvents As EnvDTE80.TextDocumentKeyPressEvents
&lt;system.contextstaticattribute()&gt;Public WithEvents
	CodeModelEvents As EnvDTE80.CodeModelEvents
&lt;system.contextstaticattribute()&gt;Public WithEvents
	DebuggerProcessEvents As EnvDTE80.DebuggerProcessEvents
&lt;system.contextstaticattribute()&gt;Public WithEvents
	DebuggerExpressionEvaluationEvents
	As EnvDTE80.DebuggerExpressionEvaluationEvents
'Event Sources End
'End of automatically generated code
#End Region
End Module
</code></pre>
</blockquote>
<p>This sets up the types of IDE events you can hook into. Now if you open the <code>EnvironmentEvents</code> module in your <code>MyMacros folder</code>, you can select the <code>BuildEvents</code> from the Class Name drop-down (the left drop-down box above the code). Then from the right Method Name drop-down, you can select one of four build events to hook into:</p>
<table border="1">
<tbody>
<tr>
<td>OnBuildBegin</td>
<td>Will fire when any build operation is fired from the IDE. It fires only once for a full solution or multiproject build operation.</td>
</tr>
<tr>
<td>OnBuildDone</td>
<td>Will fire when a build operation completes. This event fires only once for a full solution or multiproject build operation.</td>
</tr>
<tr>
<td>OnBuildProjConfigBegin</td>
<td>Will fire when a project build begins. This event is used to catch each project build event within a solution or multiproject build operation.</td>
</tr>
<tr>
<td>OnBuildProjConfigDone</td>
<td>Will fire when a project build completes. This event is used to catch the completion of each project build within a solution or multiproject build operation.</td>
</tr>
</tbody>
</table>
<p><em><strong>NOTE:</strong> These events fire even if build errors or warnings occur, and the default behavior of Visual Studio is to build all projects in a solution even if projects earlier in the build have failed.</em></p>
<p>For an example, you can add the capability to stop the build process when a project fails and display a message box in the IDE to note when the build process is complete (in case someone isn’t paying attention to the Build output).</p>
<h6>Canceling a failed build</h6>
<p>The normal behavior of Visual Studio is to build every project in a solution, even if one or more of those projects fails. If you have a half-dozen projects in your solution, then this can sometimes take a little while. It is much faster if the build quits when any of the projects fails. By handling a build event, you can ensure that.</p>
<p>Start by selecting the <code>OnBuildProjConfigDone</code> event from the Method Name drop-down above the code. The Macro IDE will automatically generate the method signature to hook the event:</p>
<blockquote><p><code> </code></p>
<pre>Private Sub BuildEvents_OnBuildProjConfigDone( _
ByVal Project As String, _
ByVal ProjectConfig As String, _
ByVal Platform As String, ByVal SolutionConfig As String, _
ByVal Success As Boolean) _
Handles BuildEvents.OnBuildProjConfigDone
End Sub</pre>
</blockquote>
<p>Since this event will fire whenev er a project completes a build, you can easily stop the rest of the build from occurring by using the <code>ExecuteCommand</code> method of the DTE object to send a <code>Build.Cancel</code> command to the IDE. The DTE object is a reference to the Visual Studio IDE, and using <code>DTE.ExecuteCommand</code> method to cancel the build is the same as hitting Ctrl-Break during a build or typing <code>Build.Cancel</code> into the IDE command window. Using the Success parameter of the event signature, you can determine whether you want to stop the build. The code looks like this:</p>
<blockquote><p><code> </code></p>
<pre>Private Sub BuildEvents_OnBuildProjConfigDone( _
ByVal Project As String, ByVal ProjectConfig As String, _
ByVal Platform As String, ByVal SolutionConfig As String, _
ByVal Success As Boolean) _
Handles BuildEvents.OnBuildProjConfigDone
If Success = False Then
'The build failed...cancel any further builds.
DTE.ExecuteCommand("Build.Cancel")
End If
End Sub</pre>
</blockquote>
<h6>Alert the user on a successful build</h6>
<p>Now, the idea was to capture the end of the build process to alert the user that the build was complete. For that you hook into the OnBuildDone event the same way you did for the project build complete. This time, you’ll use a standard Windows message box to display an informative alert:</p>
<blockquote><p><code> </code></p>
<pre>Private Sub BuildEvents_OnBuildDone( _
ByVal Scope As EnvDTE.vsBuildScope, _
ByVal Action As EnvDTE.vsBuildAction) _
Handles BuildEvents.OnBuildDone
'Alert that we finished building!
System.Windows.Forms.MessageBox.Show("Build is complete!")
End Sub</pre>
</blockquote>
<p>These are some pretty simple examples, but you have the power of the .NET Framework in your hands for any of these events so you are limited only by what you can come up with to handle. You can share these with other developers by just sending them the code to include in their own macro project or take it a step further and create a Visual Studio add-in that hooks these events and distribute it that way. If you take a look at the other IDE events you can tap into, you will understand why the Visual Studio IDE is so extensible.</p>
<p>Something to consider when you are implementing custom build events is that they are handled within the IDE only. Build events implemented using the extensibility of the IDE (macros or add-ins) will not fire if the build is run from the command line and they are executed for all project built with the IDE. However, pre- and post-build event commands will execute only for the project they are added to and even if the build is being run via the command line with <code>devenv.exe /build</code> or with MSBuild. This could be important if you want to automate your build process on a build machine.</p>
]]></content:encoded>
			<wfw:commentRss>http://visualstudiohacks.com/general/customize-your-project-build-process/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Managing Font Sizes</title>
		<link>http://visualstudiohacks.com/general/managing-font-sizes/</link>
		<comments>http://visualstudiohacks.com/general/managing-font-sizes/#comments</comments>
		<pubDate>Sat, 01 Mar 2008 17:57:00 +0000</pubDate>
		<dc:creator>javery</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://vsh.infozerk.net/?p=15</guid>
		<description><![CDATA[In my previous column Optimize Visual Studio for Presentations, I mentioned altering font size in text editor windows to improve readability for presentations.
Readable text in the editor window is critical to a good presentation, but [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>In my previous column <cite><a href="/general/optimize-visual-studio-for-presentations/">Optimize Visual Studio for Presentations</a></cite>, I mentioned altering font size in text editor windows to improve readability for presentations.</p>
<p>Readable text in the editor window is critical to a good presentation, but just as critical is the ability to read other portions of the Visual Studio IDE.  Ever tried to understand a project layout on the screen when you can’t read a #(*%$!! thing in the Project Explorer?  Ever been frustrated because you can’t see what a speaker is pointing at in the Server Explorer?</p>
<p>Visual Studio 2003 offers a command line option to set font sizes throughout Visual Studio, even in dockable windows like Server and Project Explorers.  Simply start VS via the command line and pass it the <code>/fs</code> switch, specifying a font size in points.  Visual Studio will start with your set font size and remain that way until you reset it with another <span style="font-family: Courier New;">/fs</span> switch.</p>
<p><img src="/files/media/image/FontSizes1.gif" border="0" alt="Visual Studio 2003 with increased font size" /></p>
<p>Visual Studio 2005 doesn’t have this handy command-line switch, but you can achieve the same results by altering the font size in your operating system.  In Windows XP/2000 you do this on a profile-by-profile basis.  Scott Hanselman’s presentation tricks blog post makes a great suggestion: create a separate logon profile with Administrator rights just for demos.  Set that profile’s font size to a large one and you’ll have a readily-configured system just for presentations.</p>
<p>In Windows XP, you can set the profile’s font sizes by right-clicking on the desktop, then selecting Properties.  On the Appearance tab, pull down the Font Size list and select Large or Extra Large.  Note that this will <em>not</em> affect Visual Studio 2003&#8217;s fonts, only 2005.</p>
<p><img src="/files/media/image/FontSizes2.gif" border="0" alt="Font settings from the Display Properties Appearance tab" /></p>
<p>Font sizes in Visual Studio’s text editor window won’t change, but all the other “unsettable” features will.  You’ll end up with a shiny, readable IDE and make your audience much happier.</p>
<p><img src="/files/media/image/FontSizes2.gif" border="0" alt="Visual Studio 2005 with larger fonts." /></p>
<p>Don’t forget about the command prompt, either.  Access its Properties list by clicking the application icon in the window’s upper left corner, or by hitting Ctrl-Space.  Set your font sizes on the Fonts tab.  Lucida Console 14 point is a good choice.  Also, try out the hideous bright green text on a black background.  It sounds awful, but is probably the most readable combinations.</p>
<p><img src="/files/media/image/FontSizes4.gif" border="0" alt="Setting font sizes in the command prompt." /></p>
]]></content:encoded>
			<wfw:commentRss>http://visualstudiohacks.com/general/managing-font-sizes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ask The Pros: Visual Studio .NET Addins</title>
		<link>http://visualstudiohacks.com/ask-the-pros/ask-the-pros-visual-studio-net-addins/</link>
		<comments>http://visualstudiohacks.com/ask-the-pros/ask-the-pros-visual-studio-net-addins/#comments</comments>
		<pubDate>Sat, 01 Mar 2008 17:46:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Ask The Pros]]></category>

		<guid isPermaLink="false">http://vsh.infozerk.net/?p=14</guid>
		<description><![CDATA[Leaders in our software development industry are incredibly productive for a number of reasons, one of which is their intimate familiarity with the ins and outs of the tools they use. This article is the [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Leaders in our software development industry are incredibly productive for a number of reasons, one of which is their intimate familiarity with the ins and outs of the tools they use. This article is the first in the &#8220;Ask The Pros&#8221; series which explores how some of those leaders get the most out of their tools.</p>
<p>Visual Studio is a powerful coding environment, but it can&#8217;t do everything. Smart folks around the .NET development world have created scads of addins for Visual Studio. Addins range from larger commercial packages to tightly focused freeware widgets. Commercial addins include tools such as JetBrain&#8217;s ReSharper, Developer Express&#8217;s Code Rush for productivity enhancements, and Rational Software&#8217;s XDE Developer for Visual Studio which provides a wealth of design and implementation features. Freeware, public domain, and open source addins provide everything from simple hungry whitespace deletion during editing to code complexity metrics, with documentation and testing in between.</p>
<p>In this article several highly accomplished developers, architects, and program managers discuss their favorite addins for Visual Studio .NET. Respondents for this article are:</p>
<ul>
<li><a href="http://dotavery.com/blog">James Avery</a>, Principal of InfoZerk, Inc., author of Visual Studio Hacks, and host of this website.</li>
<li><a href="http://geekswithblogs.net/bencarey/">Ben Carey</a>, Senior Consultant at Statera Consulting in Denver Colorado</li>
<li><a href="http://loudcarrot.com/Blogs/dave/">Dave Donaldson</a>, President/CEO of Arcware, Inc. and creator of CodeKeep</li>
<li><a href="http://www.hanselman.com/blog/">Scott Hanselman</a>, Chief Architect at Corillian Corporation, a leading provider of eFinance solutions</li>
<li><a href="http://blogs.msdn.com/jledgard/default.aspx">Josh Ledgard</a>, Microsoft&#8217;s Lead Program Manager for Visual Studio Aftermarket Community solutions team</li>
<li><a href="http://callmealex.com/">Alex Lowe</a>, Program Manager at Telligent Systems</li>
<li><a href="http://weblogs.asp.net/rosherove/">Roy Osherove</a>, Principal of Team Agile located in Israel, and a consultant for Agile software development and .NET Specialist</li>
</ul>
<p><strong>Ben Carey</strong></p>
<p>Ben Carey&#8217;s favorite addin is <a href="http://www.jetbrains.com/resharper/">JetBrain&#8217;s ReSharper.</a> Says Carey, <em>&#8220;I can&#8217;t imagine writing code without ReSharper. The named-refactoring support, live templates, visual indicators, and code acceleration capabilities make me feel at home in Visual Studio. ReSharper helps me stay test-driven and speeds up my development by automating frequent and repetitive actions. Overall, the tool does a tremendous job of aiding in the flow of day-to-day and minute-by-minute coding.&#8221; </em></p>
<p>Coding is a highly creative process.  Great developers seem to hit a creative zone or <a href="http://en.wikipedia.org/wiki/Flow_%28psychology%29">flow</a> where things are really clicking and some hidden corner of the brain takes over the entire process. Good tools help by enabling the developer to keep focused on the creative task at hand rather than mundane tasks like stubbing in methods or reordering method parameters. Carey&#8217;s emphatic about ReSharper&#8217;s capabilities helping him stay in the zone: <em>&#8220;I love being able to write a test for a method that I haven&#8217;t implemented yet, and then right click the class name and generate the stub. It doesn&#8217;t matter how many times I use the capabilities of ReSharper, it still brings a smile to my face every time I use the tool. I keep a printout of the shortcut keys for ReSharper beside me to constantly remind me of all the great features that are available.&#8221;</em></p>
<p>Two other favorite addins of Carey&#8217;s: <a href="http://www.testdriven.net/">TestDriven.NET</a> for its feedback inside VS.NET, and <a href="http://www.roland-weigelt.de/ghostdoc/">GhostDoc</a> for its ability to create consistent code comment structures.</p>
<p><strong>Roy Osherove</strong></p>
<p>Osherove&#8217;s favorite addin is the same as Carey&#8217;s. ReSharper has <em>&#8220;saved me so much time and effort it&#8217;s not even funny. I hope their version for 2005 will be just as good. Personally I find myself more productive with VS 2003 + Resharper than VS 2005 without. Its navigation abilities are to die for and VS has a long way to go before it can compete with them, including the amount of possible refactorings.&#8221;</em></p>
<p>Osherove finds ReSharper&#8217;s refactoring support a huge advantage.  <em>&#8220;You can of course do the basics like extract method, but you can also reorder parameters (difficult without it), convert text to a local or field variable, convert var to field and vice versa, convert to constant, extract interface, extract base class and many more.&#8221;</em></p>
<p><strong>Scott Hanselman</strong></p>
<p>Hanselman is a huge fan of another productivity tool: <a href="http://www.devexpress.com/Products/NET/CodeRush/">Developer Express&#8217;s CodeRush</a>.  He&#8217;s ardent about the time CodeRush saves him.  <em>&#8220;I use it to type 50% less in VS.NET. CodeRush lets me type less and do more. It&#8217;s more than just a macro or template expansion tool, it&#8217;s almost a reimagining of how to write code. Code, by its nature, is very verbose. Why write ‘string&#8217; when the ‘trin&#8217; middle part isn&#8217;t adding value but still wastes keystrokes? I type ‘sg&#8217; and get ‘string.&#8217; I type ‘pdt&#8217; and get a complete property definition typed as a DateType including a private field. This is just one simple example of hundreds of included templates.&#8221;</em></p>
<p>Another benefit of CodeRush is its extensibility features. Code templates can be quickly added in for quicker generation. Better yet, CodeRush provides developers a simple, quick API to use for generating their own plugins. Wizards help speed the process. Says Hanselman, <em>&#8220;I also like that CodeRush includes its own Managed &#8220;DOM&#8221; over the Visual Studio COM-based craptastic Add-in model. Writing a CodeRush Add-in is event-based and fantastically easy. Have you ever written a standard Add-in for VS.NET? Let&#8217;s just say it&#8217;s highly non-trivial. While CodeRush does cost money, a lot of folks don&#8217;t realize that DxCore, the underlying engine that supports CodeRush Add-ins is free. My favorite CodeRush Add-in is </em><a href="http://www.paraesthesia.com/blog/comments.php?id=701_0_1_0_C"> <em>CR_Documentor by Travis Illig</em></a><em>, an extension/repurposing of Lutz Roeder&#8217;s Documentor tool as a VS.NET toolbox that tracks your C# XML Comments and renders them as they would appear as MSDN help.&#8221;</em></p>
<p>[Note: Developers interested in the DxCore engine should realize that it's freely available only for personal use.]</p>
<p>Hanselman&#8217;s well-known in the development industry for his fanatical hunger in searching out new tools. See his list of Ultimate <a href="http://www.hanselman.com/blog/ScottsListOfUltimateVisualStudioNETAddIns.aspx">Visual Studio Addins</a>, and also his wider-ranging <a href="http://www.hanselman.com/blog/ScottHanselmans2005UltimateDeveloperAndPowerUsersToolList.aspx">list of Ultimate Tools</a>.</p>
<p><strong>Dave Donaldson</strong></p>
<p>Dave Donaldson joins Carey in the group of TestDriven .NET fans. Like Carey, Donaldson likes TestDriven&#8217;s integration inside VS&#8217;s IDE. He also appreciates TestDriven&#8217;s debugger integration: <em>&#8220;Another great thing about TestDriven.NET is its &#8216;Test with Debugger&#8217; functionality. The ability to set a breakpoint in code, then right-click on your project and select &#8216;Test with Debugger&#8217; is a huge timesaver.&#8221;</em></p>
<p>Donaldson&#8217;s the creator of another VS.NET addin: <a href="http://www.codekeep.net/">CodeKeep</a>.       <em>&#8220;CodeKeep is nice because it allows you to save code snippets to a central repository within the IDE; it can also search for snippets in the central repository.&#8221;</em></p>
<p><strong>Josh Ledgard</strong></p>
<p>Good addins don&#8217;t have to be huge toolsets to be highly useful to good developers. Both James Avery, author of Visual Studio Hacks and the host of this site, and Josh Ledgard favor tools which help them get code documentation done more quickly. Ledgard&#8217;s choice is VBCommenter, <a href="http://www.gotdotnet.com/workspaces/workspace.aspx?id=112b5449-f702-46e2-87fa-86bdf39a17dd">available at GotDotNet</a>.      <em> &#8220;VBCommenter was a favorite because of the required commenting documentation we would have to write in our test automation code.&#8221;</em></p>
<p>Ledgard&#8217;s also a fan of <a href="http://weblogs.asp.net/gmilano/archive/2004/05/05/126491.aspx">Gaston Milano&#8217;s Whidbey Commands tool</a> because it extends VS.NET 2003 with many of VS.NET 2005&#8217;s enhanced commands.</p>
<p><strong>Alex Lowe</strong></p>
<p>Alex Lowe&#8217;s favorite addin is <a href="http://www.eworldui.net/UnleashIt/Default.aspx">Unleash It</a>.  Lowe likes Unleash It&#8217;s ability to help web developers get simple deployment tasks done in Visual Studio .NET 2003.  <em>&#8220;Short of a full on deployment project, Visual Studio does not have adequate facilities for publishing only the required files needed to deploy and ASP.NET application. Deployment projects are overkill for lots of the work I do.&#8221;</em> Unleash It has a simple set of folder and file filters making it simple to <em>&#8220;publish (via FTP or to a local folder) only the files one should publish when preparing to do a production deployment of an ASP.NET application.&#8221;</em></p>
<p><strong>James Avery</strong></p>
<p>Like Carey, Avery is a big fan of GhostDoc, and bemoans its lack of support for VS 2005. Asked what his favorite addin was, he replied, <em>&#8220;A couple of months ago I would have said TestDriven.NET, no contest. Now that I am working more with Visual Studio Team System with the built in testing functionality I would have to go with GhostDoc. You never realize how much you miss something until you can&#8217;t use it, and of all the add-ins that have not yet been revised for Visual Studio 2005 I miss GhostDoc the most.&#8221;</em></p>
<p>GhostDoc&#8217;s simplicity is what Avery loves.  <em>&#8220;GhostDoc is the kind of add-in I like. It doesn&#8217;t try to do everything for you, it doesn&#8217;t add any additional files or complexity to your projects, it just does one thing and does it very well. GhostDoc helps make the tedious process of commenting your code with XML comments just a little bit easier.&#8221;</em></p>
<p>Avery closes out this set of tips with a list of his other favorites: The WindowsManager powertoy, SmartPaster, Control Outline Poweroy, Mouse Bindings Powertoy, CodeKeep, Pinvoke.NET, WSCF, and many others. <em>&#8220;There are so many great free add-ins available. I am always amazed by how many people don&#8217;t take advantage of these free tools.&#8221;</em></p>
<p><hr /><span style="background-color: #ffffff;"><em>Ask The Pros</em> is an ongoing series with     new installments every three or four weeks.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://visualstudiohacks.com/ask-the-pros/ask-the-pros-visual-studio-net-addins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ask The Pros: Debugging</title>
		<link>http://visualstudiohacks.com/ask-the-pros/ask-the-pros-debugging/</link>
		<comments>http://visualstudiohacks.com/ask-the-pros/ask-the-pros-debugging/#comments</comments>
		<pubDate>Sat, 01 Mar 2008 17:45:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Ask The Pros]]></category>

		<guid isPermaLink="false">http://vsh.infozerk.net/?p=13</guid>
		<description><![CDATA[Debugging is a skill with several learning plateaus. Anyone can fire up the debugger in Visual Studio, set a few breakpoints, and step through various code modules while using watches. The climb up to next [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Debugging is a skill with several learning plateaus. Anyone can fire up the debugger in Visual Studio, set a few breakpoints, and step through various code modules while using watches. The climb up to next plateau might involve learning how to use other aspects of the debugger such as the immediate window, or better understanding how to dig through various data types to find pertinent information. Higher levels of might involve full understanding of Visual Studio’s debugging capabilities, and how to best make use of the features during a debugging session.</p>
<p>Skilled software development professionals have climbed up these plateaus already, their experience honed in the school of hard knocks, and if they&#8217;re lucky, via good mentors. They&#8217;ve built up a list of tricks and methods to best use the tools available to them, tune their debugging environment, and quickly locate problems.</p>
<p>In this article several highly accomplished developers discuss their tricks for debugging in for Visual Studio .NET. Respondents for this article are:</p>
<ul>
<li><a href="http://dotavery.com/blog">James Avery</a>, Principal of Infozerk, Inc., author of Visual Studio Hacks, and host of this website.</li>
<li><a href="http://geekswithblogs.net/bencarey/">Ben Carey</a>, Senior Consultant at Statera Consulting in Denver Colorado</li>
<li><a href="http://www.gregcons.com/kateblog/">Kate Gregory</a>, founding partner of Gregory Consulting Limited</li>
<li><a href="http://www.hanselman.com/blog/">Scott Hanselman</a>, Chief Architect at Corillian Corporation, a leading provider of eFinance solutions</li>
<li><a href="http://www.srtsolutions.com/public/blog/19990">Josh Holmes</a>, principal and senior software consultant with SRT Solutions</li>
<li><a href="http://blogs.ineta.org/drewby/">Drew Robbins</a>, Developer Evangelist for Microsoft&#8217;s Heartland District</li>
<li><a href="http://weblogs.asp.net/rosherove/">Roy Osherove</a>, Principal of Team Agile located in Israel, and a consultant for Agile software development and .NET Specialist</li>
<li><a href="http://www.srtsolutions.com/public/blog/20574">Bill Wagner</a>, Founder/Consultant with SRT Solutions and author of &#8220;Effective C#&#8221;</li>
</ul>
<p><strong>Kate Gregory</strong></p>
<p>Gregory&#8217;s a fan of screen real estate when debugging. <em>&#8220;I kill dynamic help and stack my properties window in with everyone else instead of taking up half of one side vertically. Then I unpin pretty much everything&#8230;. I love screen real estate.&#8221;</em> She also tends to switch profile types and her environment settings often. <em>&#8220;I use the &#8216;Visual Studio Developer&#8217; layout most of the time. I flip to the &#8216;Visual C++ Developer&#8217; layout if I&#8217;m about to do a C++ presentation, for the audience&#8217;s sake. I use import/export settings a lot.&#8221;</em></p>
<p>Gregory also gets a lot of use from various windows, saying <em>&#8220;I make sure that autos, locals, and call stack are all visible when I&#8217;m at a breakpoint, and I LOVE the new Quick Console in 2005. I am also a longtime fan of the immediate window. Partly because, when I&#8217;m working in VB, it lets me show off my way-cool-can-you-believe-I-remember-this skills from my BASIC days of almost two decades ago, like &#8216;?&#8217; for print.&#8221;</em></p>
<p>Practical use of various VS features is high on Gregory&#8217;s list of tricks: <em>&#8220;Use the data tips. Drill into things and see what all the values are. Set conditional breakpoints. I just cringe when I watch people hit F5 over and over and over so they can get to the time through the loop when i is 15 or whatever. Use the call stack to figure out how you got here in the first place.&#8221;</em></p>
<p><strong>James Avery</strong></p>
<p>Sometimes features go unnoticed, lost in the many other features in Visual Studio. Avery points to the script debugging capability of VS:<em> &#8220;With the recent fascination of AJAX and JavaScript one feature often overlooked is the script debugging baked right into Visual Studio. All you need to do is enable it in Internet Explorer and you are ready to start debugging.&#8221;</em></p>
<p>Many, but not all, pros use various tools to help them in debugging. Avery counts two tools as helpful in his work. <em>&#8220;I am a big fan of the new Visualizer model in Visual Studio 2005. One of my favorites is the <a href="http://blog.bretts.net/PermaLink,guid,07cd8437-862e-45c6-b24e-3a286fce1b66.aspx">Cache Visualizer from Brett Johnson</a>. It gives you a great view into the ASP.NET cache, what dependencies are there, and more.&#8221; </em></p>
<p>Breakpoints are central to any debugging session, but sometimes they don&#8217;t function as you&#8217;d expected. Avery’s second helpful tool is ControlAV&#8217;s BreakPoint Helper <a href="http://www.controlav.com/bphelper/">http://www.controlav.com/bphelper/</a>. <em>&#8220;It&#8217;s great for figuring out why your breakpoints aren&#8217;t working.&#8221;</em></p>
<p><strong>Ben Carey</strong></p>
<p>TestDriven.NET <a href="http://www.testdriven.net/">http://www.testdriven.net/</a>, a Visual Studio plugin written by Jamie Cansdale, gets lots of attention from Carey, who uses <em>&#8220;TestDriven.net as a harness for my debugging. I&#8217;ve usually written a test before I write the code so I almost always have a starting point for my debugging. The &#8216;test with&#8230; debugger&#8217; functionality is a great starting point for debugging. When I have my tests defined with deterministic inputs, I always have a way to repeat the situations that I am debugging. The tests that accumulate while debugging provide me with good documentation if I ever need to come back to the code that is in question.&#8221;</em></p>
<p><strong>Scott Hanselman</strong></p>
<p>Hanselman is also a fan of TestDriven.NET. He&#8217;s emphatic about writing good tests first, though, saying <em>&#8220;Use Test Driven Development along with TestDriven.NET. It may be hard to believe, but the better your tests are the less often you&#8217;ll need to use the Interactive Debugger. I debug less when I have good tests.&#8221;</em></p>
<p>Hanselman&#8217;s blog reveals his fascination with gadgets. Hanselman carries this over into his debugging work: <em>&#8220;I use the Ergodex (</em><a href="http://www.ergodex.com/"><em>http://www.ergodex.com</em></a><em>) to create custom debugging keybindings so things like QuickWatch are one keystroke instead of two.&#8221;</em> More information on this setup can be found on <a href="http://www.hanselman.com/blog/TheErgoDexAlternativeKeyboardAndTheRiseOfCodeRushIL.aspx">Hanselman&#8217;s blog</a>.</p>
<p>Debugging-specific addins aren&#8217;t part of Hanselman&#8217;s toolkit, but he does recommend <em>&#8220;Zanebug </em><a href="http://www.adapdev.com/zanebug/"><em>http://www.adapdev.com/zanebug/</em></a><em>, a free test runner (think NUnitGui on steroids), when I want to do Testing along with integrated performance counters.&#8221;</em></p>
<p><strong>Josh Holmes</strong></p>
<p>Holmes casts a third vote for TestDriven.NET, noting the ease of writing <em>&#8220;a small unit test that will create the scenario that I&#8217;m trying to test and then I can debug that by running just that test. These unit tests are also compatible with NUnit so it makes it easy.&#8221;</em></p>
<p>Watches and breakpoints are the workhorses for Holmes. <em>&#8220;The watches allow me to quickly see what all of the data is when I enter a particular function. This is an immense help when trying to track down an issue. The breakpoint functionality in VS.NET is fantastic because it allows me to not only set a break every time I hit a line, but to only break there when certain conditions are met. For example, I can hit a break point in a loop every 10th time that it runs through or only break on a certain line if a Boolean variable is true and so on.&#8221;</em></p>
<p><strong>Roy Osherove</strong></p>
<p><em>&#8220;One of the coolest unknown features in VS 2005 is the ability to set &#8216;Trace Points&#8217;,”</em> says Osherove.  <em>“You set them either by right clicking on a breakpoint and selecting &#8216;When Hit&#8217;, or right clicking on the user pane and selecting &#8216;Add tracepoint&#8217; from one of the submenus.&#8221;</em> Osherove finds these very helpful since <em>&#8220;they do automatic tracing by method name, module and various other &#8216;macros&#8217; without breaking when the code is reached. So you get effortless tracing in debug mode.&#8221;</em> He hopes they&#8217;ll be developed further, maturing <em>&#8220;into a more configurable and extensible feature which will allow you to trace even in release mode, at the client&#8217;s site, based on configuration.&#8221;</em></p>
<p>Osherove also points out a useful attribute, DebuggerStepThrough, which <em>&#8220;allows you to &#8217;skip&#8217; pieces of code you&#8217;re not interested in stepping through using the debugger (like get-set properties for example). It makes debugging faster and less annoying.&#8221;</em></p>
<p>Debugging multiple threads can be a difficult task. Osherove offers up a useful tip for this situation: <em>&#8220;When debugging multiple threads its good to know that you have the ability to step through a specific thread&#8217;s execution path by selecting the thread you want from the &#8216;threads&#8217; combo. You can add that toolbar to the VS toolbars by rightcliking on the main toolbar.&#8221;</em></p>
<p>Osherove casts yet another vote for TestDriven.NET as an invaluable debugging tool. <em>&#8220;Jamie Cansdale rocks.&#8221;</em> He also has a terrific trick for use in the Immediate Window:<em> &#8220;Add a debug method to your code that does something like iterate through all the objects in a collection. Then you can call that method from the immediate window while in debug mode and it will enumerate various things for you. Think of it like a command-line-debugger-helper. You can write as many of those as you like.&#8221;</em></p>
<p><strong>Drew Robbins</strong></p>
<p>Fancy functionality and tools are great, but sometimes simplicity rules for usefulness. Robbins is a fan of the ease of debugging web services in the newest release of Visual Studio. <em>&#8220;Visual Studio 2005 makes it real easy to step into Web Services. You no longer need to attach to the Web Service host process and set a break point to get the debugger to stop in the Web Service code. When you are debugging your client application and get to the Web Service method call, simply choose step-into and Visual Studio 2005 does the rest. Just make sure both projects are loaded in your solution.&#8221;</em></p>
<p><strong>Bill Wagner</strong></p>
<p>Wagner usually sticks with defaults for his debugging environment; however, he has two configurations for specific scenarios. <em>&#8220;If I&#8217;m working on any code that uses large arrays (typically numerical analysis), I&#8217;ll dock the watch windows to the side of the workspace, rather than the bottom. Also, if I&#8217;m debugging drawing code, I&#8217;ll set the debugger and the debuggee side by side so I can see the effects of the drawing code, and not generate new paint messages by laying the VS window over the debuggee.&#8221;</em></p>
<p>Wagner also offers a suggestion for working in the debugger. <em>&#8220;Create an object ID for tracking an object quickly. I&#8217;ll use this in many scenarios, but the overriding reason is when I&#8217;m looking data that is buried inside some container: For example, when I need to keep track of one particular object in a collection. By right-clicking on a data object when a breakpoint is hit, you can assign an object ID to the object. Then, you can refer to that object in the watch window. It&#8217;s much easier to type &#8216;1#&#8217; rather than myCollection.GetAt( rowIndex*rowLength + colIndex ).&#8221;</em></p>
<p>Wagner&#8217;s most important tip? <em>&#8220;Subscribe to Jim Gries&#8217;s blog: </em><a href="http://blogs.msdn.com/jimgries/default.aspx"><em>http://blogs.msdn.com/jimgries/default.aspx</em></a><em> He&#8217;s always got an incredible amount of information on tips you never know you could do with the debugger.&#8221;</em></p>
<p>VISUALIZERS</p>
<p>Visualizers are one of the greatest new features in Visual Studio 2005. They enable developers to actually understand data in the debugger instead of having to struggle through undecypherable information when viewing something like a DataSet via the Watch window. Developers can write their own visualizers for VS2005. I wondered what visualizers these pros were hoping someone would come up with.</p>
<p>Gregory would like to see a DataAdapter visualizer, and also has an idea for a fun, if not overly useful visualizer. <em>&#8220;Wouldn&#8217;t it be cool if you could play streaming audio or video? But I wouldn&#8217;t use it in real life.&#8221;</em></p>
<p>Exceptions are something Avery would like to see someone write custom visualizers for. <em>&#8220;I want to see an improved view for Exceptions. While the new dialog is nice, it doesn&#8217;t help you when dealing with inner exceptions. I would love to see a visualizer that allows you to easily dig through the inner exceptions and perhaps even some better styling on the stack trace.&#8221;</em></p>
<p>Hanselman would like to see <em>&#8220;An XmlSerializer visualizer that takes any object and displays what it will look like when serializer. DotNetDan has a nice visualizer for Data up on </em><a href="http://www.codeproject.com/csharp/datadebuggervisualizer.asp"><em>http://www.codeproject.com/csharp/DataDebuggerVisualizer.asp</em></a><em> and up on Project Distributor </em><a href="http://www.projectdistributor.net/projects/project.aspx?projectid="><em>http://www.projectdistributor.net/Projects/Project.aspx?projectId=91</em></a><em> but he hasn&#8217;t updated in a while. Maybe he can be pressured by his peers.&#8221;</em></p>
<p>Wagner&#8217;s looking for better graphics support: <em>&#8220;I&#8217;d want to be able to examine image data much more effectively. I want to look at a bitmap like the zoomed mode in the image editor, and roll over a pixel to get the RGBA values.&#8221;</em></p>
<p><em>&#8220;In-memory representation of an object model (with reference counts)&#8221;</em> is a visualizer Osherove would like to see. He&#8217;s added his own contribution to the mix: <em>&#8220;I&#8217;ve created my own collection of Debug Visualizers for Regular Expressions. You can download them here: </em><a href="http://regex.osherove.com/"><em>http://regex.osherove.com</em></a><em>.&#8221;</em></p>
<p>Osherove also points out a useful DataSet Quick Watch for Visual Studio 2003 which functions much like a DataSet visualizer in VS2005. The addin can be downloaded from Code Project: <a href="http://www.codeproject.com/csharp/dswatch.asp">http://www.codeproject.com/csharp/DSWatch.asp</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://visualstudiohacks.com/ask-the-pros/ask-the-pros-debugging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ask The Pros: Keyboard Bashing With The Pros</title>
		<link>http://visualstudiohacks.com/ask-the-pros/ask-the-pros-keyboard-bashing-with-the-pros/</link>
		<comments>http://visualstudiohacks.com/ask-the-pros/ask-the-pros-keyboard-bashing-with-the-pros/#comments</comments>
		<pubDate>Sat, 01 Mar 2008 17:44:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Ask The Pros]]></category>

		<guid isPermaLink="false">http://vsh.infozerk.net/?p=12</guid>
		<description><![CDATA[I’ve written an earlier article here about using the keyboard to navigate around Visual Studio.  I’m a nut for not having to move my hands to grab the mouse for tasks which could be done [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I’ve written <a href="/navigation">an earlier article here</a> about using the keyboard to navigate around Visual Studio.  I’m a nut for not having to move my hands to grab the mouse for tasks which could be done via the keyboard.  Reaching for the mouse busts up my train of thought and slows me down, neither of which I care for.</p>
<p>For this installment of <em>Ask The Pros </em>I thought it would be interesting to get feedback from industry leaders on what their most-used and favorite keyboard commands are.  Contributors to this round of the series are:</p>
<ul>
<li><a href="http://dotavery.com/blog">James Avery</a>, Principal of Infozerk, Inc., author of Visual Studio Hacks, and host of this website</li>
<li><a href="http://loudcarrot.com/Blogs/dave/">Dave Donaldson</a>, President/CEO of Arcware, Inc. and creator of CodeKeep</li>
<li><a href="http://www.larkware.com/">Mike Gunderloy</a>, Owner of Lark Group, Inc., publisher of <em>The Daily Grind</em>, and prolific author</li>
<li><a href="http://www.hanselman.com/blog/">Scott Hanselman</a>, Chief Architect at Corillian Corporation, a leading provider of eFinance solutions</li>
<li><a href="http://weblogs.asp.net/rosherove/">Roy Osherove</a>, Principal of Team Agile located in Israel, and a consultant for Agile software development and .NET Specialist</li>
</ul>
<p><strong>Keyboard Shortcuts</strong></p>
<p>James Avery is an unabashed nut for Intellisense.  “<em>If there was a steel cage match of keyboard shortcuts there would be one clear-cut winner: Ctrl-Space. Sure there are other useful shortcut keys, but Ctrl-Space makes one of Visual Studio&#8217;s most useful features even better; it summons Intellisense wherever you are.</em>”  Avery lists off several of what he considers Intellisense’s best uses: “<em>Sitting on a blank line of code? Ctrl-Space will bring up Intellisense.  Want to see all your private member variables? Enter your prefix (_, m_, etc) and then hit Ctrl-Space, now you have a nice filtered list.</em>”</p>
<p>Avery notes an extremely useful, but often overlooked bit of goodness when trying to find method documentation with Intellisense, “<em>Most people will delete a comma or opening parenthesis to see the method documentation, but you can simply Ctrl-K, Ctrl-P.</em>”</p>
<p>Scott Hanselman likes the very basic keystrokes supporting Copy/Cut/Paste within Visual Studio.  “<em>I&#8217;m pretty much a CtrlX,C,V person along with Shift-Ctrl-B within Visual Studio.</em>”  He goes off the deep geekiness end, though, by having tacked on an <a href="http://www.ergodex.com/content.php?id=12">Ergodex input system</a> to “<em>map more complicated combinations (because I can&#8217;t hold them in my head) to a single custom labeled button.</em>”  Hanselman wrote <a href="http://www.hanselman.com/blog/TheErgoDexAlternativeKeyboardAndTheRiseOfCodeRushIL.aspx">a blog post</a> describing his use of the Ergodex and how its mapping ability may transform his work.</p>
<p>Hanselman pointed out great keyboard shortcuts outside Visual Studio which can bring great boosts in productivity.  “<em>I&#8217;m all about the Windows Key, using Windows-Q to bring up </em><a href="http://www.bayden.com/SlickRun/"><em>SlickRun from Bayden Systems</em></a><em>. In Word I tend to do Alt-V,U,Alt-VZ,T,Enter very quickly to show documents full screen for presentations. In Windows I use Ctrl-Space,N to minimize a lot, and in the Command Prompt I use Ctrl-Space,E,P and for pasting directly to the command line.”</em></p>
<p>In a bit of useful advice for folks trying to fend off carpal tunnel syndrome, or any of the other various repetitive motion injuries, Hanselman says, “<em>I try to stay balanced in my use of the keyboard vs. the mouse.</em>”</p>
<p>Dave Donaldson points out another little-known shortcut that boosts productivity for folks working in Test Driven Development environments: <em>“Ctrl+M, K &#8211; Generate Method Stub (VS 2005).  As someone who uses a test-first approach in development, the ability to write a unit test and then hit Ctrl+M, K to generate the signature of my implementation method is rockin. It&#8217;s something that most people don&#8217;t know is there, but I find a killer shortcut in a TDD environment.”</em></p>
<p>Reading someone else’s code is something everyone has to do, and it can be an infuriating task, especially if the person who wrote the code had different conventions and styles than you.  Visual Studio 2005’s ability to format code with different styles is a terrific feature, especially since you can quickly format a document in your style: <em>“Ctrl+E, D &#8211; Format Document (VS 2005).  I look at tons of code that is not mine, and having a quick way to format the code according to my settings is very useful. For instance, I like my opening curly brace on the next line of the method signature. However, if I look at someone&#8217;s code who types with the opening curly brace on the same line of the method signature, I simply hit Ctrl+E, D to format the code file using my settings.”</em></p>
<p>[For more information on how to set formatting options in Visual Studio, see James Avery’s Tip on <em><a href="http://visualstudiohacks.com/csharpformatting">C# Code Formatting</a>.]</em></p>
<p>Donaldson’s next tip is in the same code reading line: <em>“Ctrl+M, P &#8211; Stop Outlining (VS 2005, VS.NET 2003).  As useful as code regions are, there are times when I just want to expand all regions to scroll through the code. To do this, I hit Ctrl+M, P to turn off outlining, which expands all the regions.”</em></p>
<p>Donaldson finishes off with something near and dear to every developer’s heart: <em>“F5 – Start Debugging (VS 2005, VS.NET 2003, and previous versions).  Enough said.”</em></p>
<p>Roy Osherove starts off with a favorite of mine, the Clipboard ring.  <em>“The clipboard ring is not very well known, but very powerful:<br />
Pressing Ctrl-Shift-V repeatedly pastes in the last ten &#8220;Copy&#8221; operations you&#8217;ve made, saving you precious time.”</em> He also notes that “<em>Ctrl-Alt-X: the tools window (which allows you to see the Clipboard ring in vs 2003). Pressing Ctrl-DownArrow and UpArrow shifts between the open tools tabs in that tool window.”</em></p>
<p>Moving around to spots in the editor windows you’ve been is made simple by using <em>“Ctrl&#8211;(minus) and Ctrl-Shift&#8211;: gets you back and forth in the location history of the editor.”</em> Osherove points out another useful movement keystroke:  <em>“Escape &#8211; useful. Always makes the code view or current document in the tab active, no matter what tool window is active at the time.”</em></p>
<p>Two quick keystrokes save Osherove time when bouncing to specific windows.  <em>“Ctrl-Alt-S brings up the server explorer,” </em>and <em>“Ctrl-Alt-O: the output window.”</em></p>
<p>Osherove’s last tips deal with working with code in an editor window.  Commenting out blocks and un-commenting them again are serious drudgework greatly eased by <em>“Ctrl-K-C and Ctrl-K-U to [C]omment and [U]ncomment code blocks.”</em> Finally, <em>“Ctrl-Shift-Space &#8211; shows the parameter list for a method call. Saves the time going back, deleting and reentering a command after the last parameter. Phew! (If you have resharper installed, it&#8217;s Ctrl-P.”</em></p>
<p><strong>Macros</strong></p>
<p>Macros don’t seem to have much regular use with this round’s responders.  Perhaps macros aren’t particularly useful in day-to-day work and just solve occasional tricky problems. Hanselman notes “<em>I have lots of macros, but they are the kind that you use once in a blue moon. I haven&#8217;t any macros that I use daily.”</em></p>
<p><strong>Keybindings</strong></p>
<p>Avery’s favorite keybindings involve wiring up a great addin to Visual Studio: Roland Weigelt’s <a href="http://www.roland-weigelt.de/ghostdoc/">GhostDoc</a>.  <em>“Nothing like having the commands on keystrokes to make that useful add-in even more useful.</em>”</p>
<p>Many Visual Studio developers might not realize how many shortcut commands are available to them for custom binding.  Osherove gives some great advice.  <em>“The best thing you can do for yourself is look at all the currently available shortcuts by clicking Tools-Options-Keyboard and looking for whatever command you like. You can also map shortcuts to any command (or multiple shortcuts to a single command).”</em></p>
<p><strong>And Finally</strong></p>
<p>Not all highly-skilled developers are fixated on making the most of the keyboard.  Gunderloy spends his days using a tremendous number of tools.  So many, in fact, that he doesn’t take time to learn shortcuts.  He says “<em>If it wasn&#8217;t for typing code, I&#8217;d never touch the keyboard at all. I know it puts me at odds with most experts, but I drive the UI with the mouse, period. I can&#8217;t be asked to learn keyboard shortcuts or set up custom key bindings; I spend too much time switching between too many different programs all day long.</em>”</p>
]]></content:encoded>
			<wfw:commentRss>http://visualstudiohacks.com/ask-the-pros/ask-the-pros-keyboard-bashing-with-the-pros/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ask the Pros: Visual Studio Wish List</title>
		<link>http://visualstudiohacks.com/ask-the-pros/ask-the-pros-visual-studio-wish-list/</link>
		<comments>http://visualstudiohacks.com/ask-the-pros/ask-the-pros-visual-studio-wish-list/#comments</comments>
		<pubDate>Sat, 01 Mar 2008 17:43:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Ask The Pros]]></category>

		<guid isPermaLink="false">http://vsh.infozerk.net/?p=11</guid>
		<description><![CDATA[Visual Studio 2005 includes a huge amount of new functionality ranging from code snippets to refactoring.  But does it get everything done that everyone wants?  Of course not.  As Steven Wright says, &#8220;You can&#8217;t have [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Visual Studio 2005 includes a huge amount of new functionality ranging from code snippets to refactoring.  But does it get everything done that everyone wants?  Of course not.  As Steven Wright says, &#8220;You can&#8217;t have everything.  Where would you put it all?&#8221;  Some industry leaders don&#8217;t want everything, but they&#8217;ve got some great ideas on a few things which should be added into the next version of Visual Studio.</p>
<p>Contributors to this round of the series are:</p>
<ul>
<li><a href="http://dotavery.com/blog">James Avery</a>, Principal of Infozerk, Inc., author of Visual Studio Hacks, and host of this website.</li>
<li><a href="http://geekswithblogs.net/bencarey/">Ben Carey</a>, Senior Consultant at 			Statera Consulting in Denver Colorado</li>
<li><a href="http://www.gregcons.com/kateblog/">Kate Gregory</a>, founding partner of 			Gregory Consulting Limited</li>
<li><a href="http://www.srtsolutions.com/public/blog/20574">Bill Wagner</a>, Founder/Consultant 			with SRT Solutions and author of &#8220;Effective C#&#8221;</li>
</ul>
<p>Ben Carey says, &#8220;Overall, I&#8217;ve been very happy with the new version of Visual Studio, but there are a few enhancements and new features that I would like to see in upcoming versions.&#8221;  It&#8217;s not surprising that Carey, who emphatically listed ReSharper as his favorite add-in for <a href="http://visualstudiohacks.com/atpAddins">an earlier 		Ask The Pros installment</a>, wants to see &#8220;<em>additional named refactorings. I love the new refactoring support, but there are many additional refactorings that I use frequently that I would like to see integrated into Visual Studio.</em>&#8221;</p>
<p>Carey would also like to see some performance improvements in the refactoring area. 		&#8220;<em>I&#8217;m also hoping that many of the refactorings get faster in future releases. It seems that a handful of the refactorings could perform drastically faster just by taking into account how their respective items are scoped.</em>&#8221;</p>
<p>Better integration for MSBuild rates high on Carey&#8217;s list, too. &#8220;<em>I would also like to see better IDE support for MSBuild. It&#8217;s great that we have MSBuild as a foundation, but the IDE support is lacking. I&#8217;m comfortable modifying the XML directly, but I would like to have visual tools to orchestrate the build process (especially in the context of multiple projects and custom targets).</em>&#8221;</p>
<p>James Avery would like to see one feature which <a href="http://www.eclipse.org/">Eclipse</a>, 		a well-known Java development environment, supports: <em>&#8220;I would love to see support for automatically updating add-ins. This is one of the features from Eclipse that I think is very cool. You can simply enter a URL and the add-in will be downloaded, then when there are changes it can be set to automatically keep it up to date.&#8221;</em></p>
<p>Like Carey, Avery would like to see improvements in Visual Studio&#8217;s refactoring functionality. 		<em>&#8220;I would also like to see even more support for refactoring, perhaps even a templating solution, especially one that is a little bit quicker. The current refactoring sometimes takes just as long as doing the job manually would. Speaking of refactoring I think its time that the Extensibility Object Model got a good working over, currently it is pretty hard to use without keeping the documentation close at hand. It would also be nice to have a new source control interface that supported edit/merge/commit.&#8221;</em></p>
<p>Finally, Avery thinks &#8220;<em>A C# automation solution would also be nice, either Macros or some combination of Macros and templates would be excellent.</em>&#8221;</p>
<p>Bill Wagner, who <a href="http://visualstudiohacks.com/atpDebugging">gave great debugging 		tips in an earlier ATP article</a>, wants better debugging support.  &#8220;<em>I really want to see some fine-control over thread context switches.  Debugging possible race conditions is especially tricky, and reproducing them in a debugger environment is even more so.  I&#8217;d like the ability to tell the debugger to execute a thread switch at a particular statement, and to switch back again at a particular statement in that thread.</em>&#8221;</p>
<p>Wagner, who admits he &#8220;<em>still finds multi-threaded programming a bit of a 		pain</em>,&#8221; is very clear about the benefits of such an improvement: &#8220;<em>It would make it much easier to verify bugs that show up only with certain race conditions.  Once those are verified, it would make the fix easier to verify as well.</em>&#8221;</p>
<p>Kate Gregory follows up <a href="http://visualstudiohacks.com/atpDebugging">her previous 		tips on debugging</a> with ideas for improving team development communications: &#8220;<em>I want to be able to right-click a line of code and select &#8216;Who wrote this?&#8217;. I know that information should be in the source control system, and I want it! On a multi-developer project, some code is so awful you must immediately know who to find and beat&#8212; ah, have an open and frank exchange of views with.&#8221;</em></p>
<p>Spell-checking and Intellisense support in comments rates high for Gregory.  		&#8220;<em>This would actually be pretty tricky to implement because if I use a variable name in a comment I would like intellisense to help me on that, but at the same time I want an office-like autocorrect to handle things like separate/seperate or variable/varible that certain devs in my shop are constantly getting wrong.</em>&#8221;</p>
<p>Lastly, Gregory would like Visual Studio to have more assistance when developing for 		SharePoint. &#8220;<em>It&#8217;s pretty much the last kind of work where I need to have several other windows (a command prompt, some windows explorer windows for file copies, the gac, &#8230;) open as well as Visual Studio.</em>&#8220;  She admits her wish list for 		that particular feature area is &#8220;<em>a bit too long</em>&#8221; for an Ask The Pros article&#8230;</p>
<p><hr /><em>Ask The Pros</em> is an ongoing series with new installments every three or four 		weeks.</p>
]]></content:encoded>
			<wfw:commentRss>http://visualstudiohacks.com/ask-the-pros/ask-the-pros-visual-studio-wish-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
