<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Habib Heydarian's Blog @ Microsoft : Visual Studio 2008</title><link>http://blogs.msdn.com/habibh/archive/tags/Visual+Studio+2008/default.aspx</link><description>Tags: Visual Studio 2008</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>How to Count the Lines of Code (LOC) in your application using Visual Studio</title><link>http://blogs.msdn.com/habibh/archive/2009/10/27/how-to-count-the-lines-of-code-loc-in-your-application-using-visual-studio.aspx</link><pubDate>Wed, 28 Oct 2009 01:30:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9913841</guid><dc:creator>habibh</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/habibh/comments/9913841.aspx</comments><wfw:commentRss>http://blogs.msdn.com/habibh/commentrss.aspx?PostID=9913841</wfw:commentRss><description>&lt;p&gt;I was talking to someone the other day and he asked me whether Visual Studio has a tool to count the lines of code in an application. It occurred to me that others might be interested in the answer so I decided to blog about it.&lt;/p&gt;  &lt;p&gt;There is a tool called Code Metrics in Visual Studio 2008 and 2010 that among other things, counts the lines of code in a project. Using Code Metrics is very simple. In Solution Explorer, select the project that you want to know the LOC for, right-click and select &amp;quot;Calculate Code Metrics&amp;quot;.&lt;/p&gt;  &lt;p&gt;The screenshot below shows the Code Metrics window. One of the nice things about the Code Metrics window is that it shows you the lines of code per project, namespace, class or method.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/habibh/WindowsLiveWriter/Howmany_D0FD/image_3.png" width="1053" height="356" /&gt; &lt;/p&gt;  &lt;p&gt;Habib Heydarian.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9913841" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/habibh/archive/tags/Visual+Studio+2010/default.aspx">Visual Studio 2010</category><category domain="http://blogs.msdn.com/habibh/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category><category domain="http://blogs.msdn.com/habibh/archive/tags/Code+Analysis/default.aspx">Code Analysis</category></item><item><title>How to edit code when debugging a 64-bit application</title><link>http://blogs.msdn.com/habibh/archive/2009/10/12/how-to-edit-code-when-debugging-a-64-bit-application.aspx</link><pubDate>Tue, 13 Oct 2009 05:19:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9906445</guid><dc:creator>habibh</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/habibh/comments/9906445.aspx</comments><wfw:commentRss>http://blogs.msdn.com/habibh/commentrss.aspx?PostID=9906445</wfw:commentRss><description>&lt;p&gt;One of the most popular features in the Visual Studio debugger is the ability to edit code during a debug session and have the changes apply without having to stop the debugger, recompile the application and then run the application to verify the changes. This feature is affectionately known as &amp;quot;Edit and Continue&amp;quot; or &amp;quot;E&amp;amp;C&amp;quot; for short.&lt;/p&gt;  &lt;p&gt;Unfortunately, Edit and Continue isn't supported on 64-bit. In fact, if you try to use Edit &amp;amp; Continue when debugging a 64-bit application, you get the following error message: &amp;quot;Changes to 64-bit applications are not allowed&amp;quot;, as shown below.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/habibh/WindowsLiveWriter/9d46e66e51d6_13278/image_7.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Edit and Continue dialog" border="0" alt="Edit and Continue dialog" src="http://blogs.msdn.com/blogfiles/habibh/WindowsLiveWriter/9d46e66e51d6_13278/image_thumb_2.png" width="441" height="183" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Many users may not be aware that by default, when you create a C# or VB project in Visual Studio 2008, the &amp;quot;Platform&amp;quot; for the project is set to &amp;quot;Any CPU&amp;quot;. This means that if you run your application on a 32-bit operating system, your application will run as a 32-bit process and similarly, if you run your application on a 64-bit operating system, the application will be 64-bit. The consequence of &amp;quot;Any CPU&amp;quot; is that when you try to debug your application on a 64-bit operating system, you won't be able to use the Edit and Continue feature.&lt;/p&gt;  &lt;p&gt;However, there is a workaround. During development, you can set the Platform for your project to 32-bit which means that your application will run as a 32-bit process even on a 64-bit operating system. This is known as WOW64 or &amp;quot;Windows On Windows&amp;quot; which basically means that you can run a 32-bit application on a 64-bit operating system.&lt;/p&gt;  &lt;p&gt;So, how do you set the Platform for your project to 32-bit? Well, you need to create a 32-bit platform using the Visual Studio Configuration Manager. Here is a short walkthrough.&lt;/p&gt;  &lt;p&gt;First, open the &amp;quot;Configuration Manager&amp;quot; dialog from Build –&amp;gt; Configuration Manager. The Configuration Manager dialog is shown below.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Configuration Manager" border="0" alt="Configuration Manager" src="http://blogs.msdn.com/blogfiles/habibh/WindowsLiveWriter/9d46e66e51d6_13278/image_12.png" width="720" height="451" /&gt; &lt;/p&gt;  &lt;p&gt;On the Configuration Manager dialog, select &amp;quot;New...&amp;quot; from the &amp;quot;Active solution platform&amp;quot; dropdown, as shown here.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Create New Platform" border="0" alt="Create New Platform" src="http://blogs.msdn.com/blogfiles/habibh/WindowsLiveWriter/9d46e66e51d6_13278/image_15.png" width="710" height="441" /&gt; &lt;/p&gt;  &lt;p&gt;On the &amp;quot;New Solution Platform&amp;quot; dialog, select &amp;quot;x86&amp;quot; and press the OK button.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="New Solution Platform dialog" border="0" alt="New Solution Platform dialog" src="http://blogs.msdn.com/blogfiles/habibh/WindowsLiveWriter/9d46e66e51d6_13278/image_18.png" width="353" height="229" /&gt; &lt;/p&gt;  &lt;p&gt;That's it! Your project is now compiled as a 32-bit application and therefore, it also runs as a 32-bit process.&lt;/p&gt;  &lt;p&gt;An important note to remember is that if you are planning to deploy your application to a 64-bit machine and you want the application to run as a 64-bit process, don't forget to set the project platform back to &amp;quot;Any CPU&amp;quot; and compile the project.&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;Habib Heydarian.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9906445" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/habibh/archive/tags/Debugging/default.aspx">Debugging</category><category domain="http://blogs.msdn.com/habibh/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category></item><item><title>Class Breakpoint: How to set a breakpoint on a C++ class in the Visual Studio Debugger</title><link>http://blogs.msdn.com/habibh/archive/2009/09/10/class-breakpoint-how-to-set-a-breakpoint-on-a-c-class-in-the-visual-studio-debugger.aspx</link><pubDate>Thu, 10 Sep 2009 21:34:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9893993</guid><dc:creator>habibh</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/habibh/comments/9893993.aspx</comments><wfw:commentRss>http://blogs.msdn.com/habibh/commentrss.aspx?PostID=9893993</wfw:commentRss><description>&lt;p&gt;When debugging an application, there are times when you want the debugger to stop whenever any of the functions in a particular class are called. An example of this may be when you are trying to find out which object is calling your class. Of course, you could manually set a breakpoint on every function in your class but that is both tedious and time consuming, not to mention error prone (what if you miss one of the functions?)&lt;/p&gt;  &lt;p&gt;What you really want is a &amp;quot;class breakpoint&amp;quot;, that is, a breakpoint on an entire class and all its functions, operators, constructors, etc. In Visual Studio, you can set a &amp;quot;class breakpoint&amp;quot; using a function breakpoint. Specifically, when setting a function breakpoint, instead of specifying a function name, you can specify the name of the class followed by the '*' wildcard character. The '*' wildcard indicates to the debugger to break on &amp;quot;anything&amp;quot; that is called within the class.&lt;/p&gt;  &lt;p&gt;Let's go through an example. In the following class declaration, I want to set a breakpoint on all methods in the &lt;font face="Courier New"&gt;Stack&lt;/font&gt; class.&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Stack&lt;br /&gt;{&lt;br /&gt;&lt;span style="color: #0000ff"&gt;private&lt;/span&gt;:&lt;br /&gt;    list&amp;lt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;&amp;gt; m_list;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt;:&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; push(&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; i);&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; pop();&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; depth() &lt;span style="color: #0000ff"&gt;const&lt;/span&gt;;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; empty() &lt;span style="color: #0000ff"&gt;const&lt;/span&gt;;&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;To do that, I can bring up the &amp;quot;New Breakpoint&amp;quot; dialog by pressing CTRL+B as shown below and type in &lt;font face="Courier New"&gt;Stack::*&lt;/font&gt; for the function name, as shown below.&lt;/p&gt;

&lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="New Breakpoint dialog" border="0" alt="New Breakpoint dialog" src="http://blogs.msdn.com/blogfiles/habibh/WindowsLiveWriter/HowtosetaClassBreakpointinVisualStudio20_A2BD/image_9.png" width="588" height="261" /&gt; &lt;/p&gt;

&lt;p&gt;After setting the breakpoint, the Breakpoints window displays the new breakpoint just like any other breakpoint, as shown below.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Breakpoint on all functions" border="0" alt="Breakpoint on all functions" src="http://blogs.msdn.com/blogfiles/habibh/WindowsLiveWriter/HowtosetaClassBreakpointinVisualStudio20_A2BD/image_6.png" width="634" height="230" /&gt; &lt;/p&gt;

&lt;p&gt;As soon as any of the functions in the Stack class are called, the debugger will stop at the function. Also, the Breakpoints window will show the fact that multiple breakpoints were set in the class. In the following screenshot, the function push() was called and the debugger stopped since there was a class breakpoint on the Stack class.&lt;/p&gt;

&lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Class Breakpoint" border="0" alt="Class Breakpoint" src="http://blogs.msdn.com/blogfiles/habibh/WindowsLiveWriter/HowtosetaClassBreakpointinVisualStudio20_A2BD/image_12.png" width="590" height="230" /&gt; &lt;/p&gt;

&lt;p&gt;Habib Heydarian.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9893993" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/habibh/archive/tags/Debugging/default.aspx">Debugging</category><category domain="http://blogs.msdn.com/habibh/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category></item><item><title>Troubleshooting common breakpoint problems in the Visual Studio debugger (Part I)</title><link>http://blogs.msdn.com/habibh/archive/2009/09/01/troubleshooting-common-breakpoint-problems-in-the-visual-studio-debugger-part-i.aspx</link><pubDate>Wed, 02 Sep 2009 03:41:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9898241</guid><dc:creator>habibh</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/habibh/comments/9898241.aspx</comments><wfw:commentRss>http://blogs.msdn.com/habibh/commentrss.aspx?PostID=9898241</wfw:commentRss><description>&lt;p&gt;On the Visual Studio debugger team, one of the areas where we regularly receive feedback is when breakpoints don't work. Furthermore, some of the error messages that the debugger displays when a breakpoint fails are generic so it might be hard to diagnose why a breakpoint doesn't work correctly (we're working to improve these error messages). In this blog post and subsequent posts, I'm going to cover the most common reasons why breakpoints don't work in the Visual Studio debugger and provide potential workarounds.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;When trying to set a breakpoint in a C# or VB method, you see the following error message:&lt;/p&gt;  &lt;p&gt;&lt;em&gt;The common language runtime was unable to set the breakpoint.&lt;/em&gt;&lt;/p&gt;  &lt;h3&gt;Description&lt;/h3&gt;  &lt;p&gt;This error occurs because the application that you are debugging is optimized and the method where you are trying to set the breakpoint has been optimized away and hence, doesn't exist in the running application. This typically happens if your project configuration is set to &lt;strong&gt;Release&lt;/strong&gt; mode which enables the compiler setting to optimize code, as shown below. One way to fix this problem is to set the project configuration to &lt;strong&gt;Debug &lt;/strong&gt;which disables optimizations.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Project Properties" border="0" alt="Project Properties" src="http://blogs.msdn.com/blogfiles/habibh/WindowsLiveWriter/Troubleshootingcommonbreakpointproblemsi_F784/image_3.png" width="805" height="350" /&gt;&lt;/p&gt;  &lt;p&gt;Habib Heydarian.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9898241" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/habibh/archive/tags/Debugging/default.aspx">Debugging</category><category domain="http://blogs.msdn.com/habibh/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category><category domain="http://blogs.msdn.com/habibh/archive/tags/VSTS+Developing/default.aspx">VSTS Developing</category></item><item><title>How to debug a 64-bit dump using the Visual Studio debugger</title><link>http://blogs.msdn.com/habibh/archive/2009/08/31/how-to-debug-a-64-bit-dump-using-the-visual-studio-debugger.aspx</link><pubDate>Tue, 01 Sep 2009 04:48:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9897837</guid><dc:creator>habibh</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/habibh/comments/9897837.aspx</comments><wfw:commentRss>http://blogs.msdn.com/habibh/commentrss.aspx?PostID=9897837</wfw:commentRss><description>&lt;p&gt;One of the questions that comes up about debugging dump files is how to debug a dump file that was created from a 64-bit process. The reason why this question comes up is because Visual Studio itself is a 32-bit application and therefore, cannot debug a 64-bit dump file (or process). As a result, the first time that a developer tries to debug a 64-bit dump file, he (or she) typically runs across the following error message:&lt;/p&gt;  &lt;p&gt;&lt;em&gt;The 32-bit version of Visual Studio cannot debug 64-bit processes or 64-bit dumps. Please remote debug with the 64-bit version of Visual Studio Remote Debugging Monitor (MSVSMON.exe) instead.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;To fix this problem, before you start debugging the dump file, run the 64-bit version of msvsmon.exe from &lt;em&gt;%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger\x64&lt;/em&gt;. However, even after doing so, you might see the following error message:&lt;/p&gt;  &lt;p&gt;&lt;em&gt;The version of this file is not compatible with the version of Windows you're running. Check you computer's system information to see whether you need an x86 (32-bit) or x64 (64-bit) version of the program, and then contact the software publisher.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Unfortunately, this error is rather confusing and doesn't tell you anything about the root cause. The problem here is that you are running a 32-bit operating system and therefore, cannot run a 64-bit process. Hence, you need a 64-bit operating system to run the 64-bit version of msvsmon.exe.&lt;/p&gt;  &lt;p&gt;To summarize, in order to debug a 64-bit dump in the Visual Studio debugger, the following conditions need to be met:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;You need a 64-bit version of Windows&lt;/li&gt;    &lt;li&gt;You need to run the 64-bit version of msvsmon.exe first&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Habib Heydarian.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9897837" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/habibh/archive/tags/Debugging/default.aspx">Debugging</category><category domain="http://blogs.msdn.com/habibh/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category><category domain="http://blogs.msdn.com/habibh/archive/tags/VSTS+Developing/default.aspx">VSTS Developing</category></item><item><title>A few facts about the DinnerNow.net 3.1 sample application</title><link>http://blogs.msdn.com/habibh/archive/2009/08/18/a-few-facts-about-the-dinnernow-net-3-1-sample-application.aspx</link><pubDate>Tue, 18 Aug 2009 11:31:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9872035</guid><dc:creator>habibh</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/habibh/comments/9872035.aspx</comments><wfw:commentRss>http://blogs.msdn.com/habibh/commentrss.aspx?PostID=9872035</wfw:commentRss><description>&lt;p&gt;Now that the &lt;a href="http://blogs.msdn.com/habibh/archive/2009/08/17/dinnernow-net-3-1-for-windows-7-and-windows-server-2008-r2-released.aspx"&gt;DinnerNow.net 3.1&lt;/a&gt; sample application has been released, I thought I'd share some information about the project to help developers learn more about DinnerNow.net and what they can expect after downloading it.&lt;/p&gt;  &lt;p&gt;The following table summarizes the artifacts (source code, images, et.c) that make up the DinnerNow.net 3.1 sample application.&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="545"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="391"&gt;&lt;strong&gt;DinnerNow Artifact&lt;/strong&gt;&lt;/td&gt;        &lt;td valign="top" width="152"&gt;&lt;strong&gt;Count&lt;/strong&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="391"&gt;Number of solutions (including master solution)&lt;/td&gt;        &lt;td valign="top" width="152"&gt;12&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="391"&gt;Number of projects&lt;/td&gt;        &lt;td valign="top" width="152"&gt;37&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="391"&gt;Number of C# source files (*.cs)&lt;/td&gt;        &lt;td valign="top" width="152"&gt;356&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="391"&gt;Number of C# LOC (Lines Of Code) excluding comments&lt;/td&gt;        &lt;td valign="top" width="152"&gt;32,245&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="391"&gt;Number of ASPX/ASCX pages&lt;/td&gt;        &lt;td valign="top" width="152"&gt;12&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="391"&gt;Number of WCF services (*.svc)&lt;/td&gt;        &lt;td valign="top" width="152"&gt;9&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="391"&gt;Number of databases&lt;/td&gt;        &lt;td valign="top" width="152"&gt;3&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="391"&gt;Number of WPF forms (*.xaml)&lt;/td&gt;        &lt;td valign="top" width="152"&gt;15&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="391"&gt;Number of HTML pages (*.htm)&lt;/td&gt;        &lt;td valign="top" width="152"&gt;19&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="391"&gt;Number of CSS files (*.css)&lt;/td&gt;        &lt;td valign="top" width="152"&gt;10&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="391"&gt;Number of images (*.gif, *.jpg, *.png)&lt;/td&gt;        &lt;td valign="top" width="152"&gt;248&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;In a follow up post, I will discuss the overall architecture of DinnerNow.net and the structure of the solutions.&lt;/p&gt;  &lt;p&gt;Habib Heydarian.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9872035" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/habibh/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category><category domain="http://blogs.msdn.com/habibh/archive/tags/DinnerNow.net/default.aspx">DinnerNow.net</category></item><item><title>DinnerNow.net 3.1 for Windows 7 and Windows Server 2008 R2 released</title><link>http://blogs.msdn.com/habibh/archive/2009/08/17/dinnernow-net-3-1-for-windows-7-and-windows-server-2008-r2-released.aspx</link><pubDate>Mon, 17 Aug 2009 10:03:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9872017</guid><dc:creator>habibh</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/habibh/comments/9872017.aspx</comments><wfw:commentRss>http://blogs.msdn.com/habibh/commentrss.aspx?PostID=9872017</wfw:commentRss><description>&lt;p&gt;DinnerNow.net 3.1 follows in the footsteps of the &lt;a href="http://blogs.msdn.com/habibh/archive/2009/07/04/dinnernow-net-3-0-for-visual-studio-2008-sp1-and-net-framework-3-5-sp1-is-here.aspx"&gt;3.0 release&lt;/a&gt; of DinnerNow.net by adding support for new Microsoft operating systems and platforms. New in DinnerNow 3.1 is support for Windows 7 and Windows Server 2008 R2. Also, DinnerNow 3.1 adds support for 64-bit operating systems and SQL Server 2008. For a complete list of new features in DinnerNow 3.1, see the sections below. To learn more about he DinnerNow sample application, visit the &lt;a href="http://dinnernow.codeplex.com/"&gt;DinnerNow&lt;/a&gt; website.&lt;/p&gt;  &lt;p&gt;You can download DinnerNow.net 3.1 from &lt;a href="http://dinnernow.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=31480"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="DinnerNow scenario" border="0" alt="DinnerNow scenario" src="http://blogs.msdn.com/blogfiles/habibh/WindowsLiveWriter/Din.1forWindows7andWindowsServer2008R2re_C296/image_7.png" width="707" height="384" /&gt; &lt;/p&gt;  &lt;h2&gt;1) Support for new Microsoft operating systems and technologies&lt;/h2&gt;  &lt;p&gt;DinnerNow.net 3.1 adds support for the following releases from Microsoft.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Windows 7 RTM (32-bit and 64-bit) &lt;/li&gt;    &lt;li&gt;Windows Server 2008 R2 RTM (64-bit only) &lt;/li&gt;    &lt;li&gt;Windows PowerShell 2.0 &lt;/li&gt;    &lt;li&gt;64-bit support for Windows Vista SP2 and Windows Server 2008 SP2 &lt;/li&gt;    &lt;li&gt;SQL Server 2008 Express Edition Service Pack 1 (32-bit and 64-bit) &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;&lt;font color="#ff0000"&gt;NOTE:&lt;/font&gt;&lt;/strong&gt; In version 3.1, support for SQL Server 2005 Express has been replaced with SQL Server 2008 Express SP1.&lt;/p&gt;  &lt;h2&gt;2) Bug fixes&lt;/h2&gt;  &lt;p&gt;DinnerNow 3.1 fixes the following issues.&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="0" width="916"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="56" align="center"&gt;&lt;b&gt;Priority&lt;/b&gt;&lt;/td&gt;        &lt;td valign="top" width="858"&gt;&lt;b&gt;Title&lt;/b&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="56" align="center"&gt;1&lt;/td&gt;        &lt;td valign="top" width="858"&gt;Detection logic for PowerShell installation is broken on Windows 7 and Windows Server 2008 R2&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="56" align="center"&gt;1&lt;/td&gt;        &lt;td valign="top" width="858"&gt;Fix setup to support installation on 64-bit&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="56" align="center"&gt;1&lt;/td&gt;        &lt;td valign="top" width="858"&gt;Windows Server 2008 R2: Dependency Checker crashes on startup.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="56" align="center"&gt;1&lt;/td&gt;        &lt;td valign="top" width="858"&gt;64-bit: IIS Manager crashes when opening the Image Copyright control panel&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="56" align="center"&gt;1&lt;/td&gt;        &lt;td valign="top" width="858"&gt;64-bit: Images don't show up on the DinnerNow website&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="56" align="center"&gt;1&lt;/td&gt;        &lt;td valign="top" width="858"&gt;64-bit: In the AliasDatabaseServer project, some project references are broken&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="56" align="center"&gt;1&lt;/td&gt;        &lt;td valign="top" width="858"&gt;System.InvalidOperationException: The type '&amp;quot;DinnerNow.Services.OrderService', provided as the Service attribute value in the ServiceHost directive could not be found.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="56" align="center"&gt;1&lt;/td&gt;        &lt;td valign="top" width="858"&gt;Build break: In SQL Server 2008, the type Microsoft.SqlServer.Management.Smo.Wmi.ServerAlias has moved from Microsoft.SqlServer.Smo.dll to Microsoft.SqlServer.SqlWmiManagement.dll&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="56" align="center"&gt;1&lt;/td&gt;        &lt;td valign="top" width="858"&gt;Windows 7: IIS Worker Process (w3wp.exe) doesn't have access to the DinnerNow.net databases.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="56" align="center"&gt;1&lt;/td&gt;        &lt;td valign="top" width="858"&gt;Windows Server 2008 R2: Registering with CardSpace crashes the DinnerNow website.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="56" align="center"&gt;1&lt;/td&gt;        &lt;td valign="top" width="858"&gt;DinnerNow 3.1 needs to support SQL Server 2008 Express Edition SP1&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="56" align="center"&gt;1&lt;/td&gt;        &lt;td valign="top" width="858"&gt;Windows 7: IIS installation script doesn't work&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="56" align="center"&gt;2&lt;/td&gt;        &lt;td valign="top" width="858"&gt;Unit Test &amp;quot;DinnerNow.Tests.MenuSyndicationServiceTest.GetRestaurantAtomTest&amp;quot; fails with System.Net.WebException&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="56" align="center"&gt;2&lt;/td&gt;        &lt;td valign="top" width="858"&gt;TestOrderProcessWorkflow: Unit Test fails with System.InvalidOperationException&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="56" align="center"&gt;2&lt;/td&gt;        &lt;td valign="top" width="858"&gt;GetRestaurantRssTest: Unit Test fails with System.Net.WebException&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="56" align="center"&gt;2&lt;/td&gt;        &lt;td valign="top" width="858"&gt;GetRestaurantCategoriesWCFTest: Unit Test fails with System.InvalidOperationException&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;As always, your feedback is welcome.&lt;/p&gt;  &lt;p&gt;Habib Heydarian.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9872017" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/habibh/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category><category domain="http://blogs.msdn.com/habibh/archive/tags/DinnerNow.net/default.aspx">DinnerNow.net</category></item><item><title>How to detect the .NET Framework directory using PowerShell</title><link>http://blogs.msdn.com/habibh/archive/2009/08/11/how-to-detect-the-net-framework-directory-using-powershell.aspx</link><pubDate>Wed, 12 Aug 2009 01:41:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9865098</guid><dc:creator>habibh</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/habibh/comments/9865098.aspx</comments><wfw:commentRss>http://blogs.msdn.com/habibh/commentrss.aspx?PostID=9865098</wfw:commentRss><description>&lt;p&gt;As 64-bit machines become mainstream, one of the problems that developers run into is dealing with registry keys and directories. This is because many applications and runtimes are designed to run on both 64-bit and &lt;a href="http://en.wikipedia.org/wiki/WOW64"&gt;WOW64&lt;/a&gt;. The problem comes about because the same application or runtime is installed in two different directories or has two separate entries in the Windows Registry (both 32-bit version and 64-bit version).&lt;/p&gt;  &lt;p&gt;Take the .NET Framework for example. On a 64-bit operating system, the 32-bit version of the framework is installed in&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;C:\Windows\Microsoft.NET\Framework\v2.0.50727&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;while the 64-bit version of the framework on the same machine is installed in:&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;C:\Windows\Microsoft.NET\&lt;font color="#ff0000"&gt;&lt;strong&gt;Framework64&lt;/strong&gt;&lt;/font&gt;\v2.0.50727&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;To take this example further, let's say that as part of your application's setup, you have hard-coded the location of the .NET Framework. There is a good chance now that when you migrate your application to 64-bit, your setup application is broken.&lt;/p&gt;  &lt;p&gt;If you are using PowerShell as part of your setup application, you can detect the directory of the .NET Framework, as shown below. The &lt;font face="Courier New"&gt;Get-FrameworkDirectory&lt;/font&gt; cmdlet returns the default .NET Framework directory regardless of whether you are running on 32-bit or 64-bit.&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; Get-FrameworkDirectory()&lt;br /&gt;{&lt;br /&gt;    $([System.Runtime.InteropServices.RuntimeEnvironment]::GetRuntimeDirectory())&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;In the sample below, I'm using the &lt;font face="Courier New"&gt;Get-FrameworkDirectory&lt;/font&gt; cmdlet to find the location of aspnet_regsql.exe.&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; Create-SQLASPNETMembership&lt;br /&gt;{&lt;br /&gt;    Write-Host &lt;span style="color: #006080"&gt;&amp;quot;Create the ASPNETDB SQL Server database for the membership system&amp;quot;&lt;/span&gt;&lt;br /&gt;    $frameworkDir = Get-FrameworkDirectory&lt;br /&gt;    Set-Alias aspnet_regsql (Join-Path $frameworkDir &lt;span style="color: #006080"&gt;&amp;quot;aspnet_regsql.exe&amp;quot;&lt;/span&gt;)&lt;br /&gt;    aspnet_regsql -S DinnerNow -E -A all    &lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;Habib Heydarian.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9865098" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/habibh/archive/tags/Technology/default.aspx">Technology</category><category domain="http://blogs.msdn.com/habibh/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category></item><item><title>Just released: Patch to make NetCFSvcUtil.exe work on Windows 7 (and other operating systems)</title><link>http://blogs.msdn.com/habibh/archive/2009/08/10/just-released-patch-to-make-netcfsvcutil-exe-work-on-windows-7-and-other-operating-systems.aspx</link><pubDate>Mon, 10 Aug 2009 10:31:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9860246</guid><dc:creator>habibh</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/habibh/comments/9860246.aspx</comments><wfw:commentRss>http://blogs.msdn.com/habibh/commentrss.aspx?PostID=9860246</wfw:commentRss><description>&lt;p&gt;In an earlier blog &lt;a href="http://blogs.msdn.com/habibh/archive/2009/06/26/netcfsvcutil-exe-and-windows-7.aspx"&gt;post&lt;/a&gt;, I mentioned that NetCFSvcUtil.exe (available as part of Power Toys for .NET Compact Framework 3.5) is broken on the following operating systems:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Window 7 RTM &lt;/li&gt;    &lt;li&gt;Windows Server 2008 R2 &lt;/li&gt;    &lt;li&gt;Windows Vista SP2 &lt;/li&gt;    &lt;li&gt;Windows Server 2008 SP2 &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Specifically, when you try to run NetCFSvcUtil.exe on these operating systems, you might see the following error message:&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Error: An error occurred in the tool.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Error: Error in the application.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;The good news is that the Windows Mobile Developer team released a patch today that fixes this problem. You can download the new version of NetCFSvcUtil from &lt;a href="http://download.microsoft.com/download/6/2/0/6205ED05-E435-44FC-AA82-B763CA5F8B1A/NetCFSvcUtil.exe"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Habib Heydarian.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9860246" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/habibh/archive/tags/Announcements/default.aspx">Announcements</category><category domain="http://blogs.msdn.com/habibh/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category></item><item><title>Windows 7 RTM Training Kit For Developers is here!</title><link>http://blogs.msdn.com/habibh/archive/2009/08/07/windows-7-rtm-training-kit-for-developers-is-here.aspx</link><pubDate>Fri, 07 Aug 2009 10:02:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9859894</guid><dc:creator>habibh</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/habibh/comments/9859894.aspx</comments><wfw:commentRss>http://blogs.msdn.com/habibh/commentrss.aspx?PostID=9859894</wfw:commentRss><description>&lt;p&gt;If you are a developer and you are planning to write applications for Windows 7, then one of the best places to start is the &lt;a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=1c333f06-fadb-4d93-9c80-402621c600e7"&gt;Windows 7 Training Kit For Developers&lt;/a&gt; which was released today.&lt;/p&gt;  &lt;p&gt;The Window 7 Training Kit has everything you need to get started with programming Windows 7, including sample code, videos, presentations, Hands-On Labs (HOLs), etc. Most of the samples come with Visual Studio 2008 projects which means that you can open and debug these samples in Visual Studio 2008!&lt;/p&gt;  &lt;p&gt;The training kit has a few prerequisites. Once you download the training kit, click the &lt;strong&gt;Prerequisites&lt;/strong&gt; link to navigate to the page where you can download all the prerequisites.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Windows 7 Training Kit" border="0" alt="Windows 7 Training Kit" src="http://blogs.msdn.com/blogfiles/habibh/WindowsLiveWriter/Windows7RTMTrainingKitForDevelopersisher_13B73/image_3.png" width="516" height="373" /&gt; &lt;/p&gt;  &lt;p&gt;Habib Heydarian.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9859894" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/habibh/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category><category domain="http://blogs.msdn.com/habibh/archive/tags/Windows+7/default.aspx">Windows 7</category></item><item><title>Debugging 101: How to skip over code in the Visual Studio Debugger</title><link>http://blogs.msdn.com/habibh/archive/2009/07/30/debugging-101-how-to-skip-over-code-in-the-visual-studio-debugger.aspx</link><pubDate>Thu, 30 Jul 2009 10:37:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9852986</guid><dc:creator>habibh</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/habibh/comments/9852986.aspx</comments><wfw:commentRss>http://blogs.msdn.com/habibh/commentrss.aspx?PostID=9852986</wfw:commentRss><description>&lt;p&gt;One of the questions that comes up regularly on newsgroups is &amp;quot;How do I skip over a section of my code in the Visual Studio debugger?&amp;quot; The answer depends on the meaning of the word &amp;quot;skip&amp;quot; but in general, there are three ways that you can skip over a section of code in the debugger. I'll describe these three techniques using the following code sample.&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; DecrementUnitsInStock(&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; quantity)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;    &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; success = Product.DecrementProductUnitsInStock(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.ID, quantity);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (success)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;       &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.UnitsInStock -= quantity;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;    &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; success;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;h2&gt;Step Over (F10)&lt;/h2&gt;

&lt;p&gt;Step Over (F10) is by far the most well known command for skipping over an entire method but still execute the function that you are stepping over. When you Step Over a line, it executes all method calls that are on that line (including methods that take other methods as their argument) and stop on the next line. However, if any of the methods that you are stepping over contain a breakpoint or throw an exception, the debugger will stop in the method.&lt;/p&gt;

&lt;p&gt;In the screenshot below, pressing F10 will execute the DecrementProductUnitInStock() method without tracing through it and will stop at the next line.&lt;/p&gt;

&lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Step Over (F10)" border="0" alt="Step Over (F10)" src="http://blogs.msdn.com/blogfiles/habibh/WindowsLiveWriter/Debugging101SkippingovercodeintheVisualS_96E7/image_23.png" width="759" height="190" /&gt; &lt;/p&gt;

&lt;h2&gt;Run To Cursor (CTRL+F10)&lt;/h2&gt;

&lt;p&gt;Think of &lt;strong&gt;Run To Cursor&lt;/strong&gt; as an &amp;quot;invisible one-shot breakpoint&amp;quot;. What does that mean exactly? It means that just like a breakpoint, the debugger will execute your application up to where your cursor is and break. In the following example, I placed my cursor on the line &amp;quot;return success&amp;quot; and pressed CTRL+F10. The debugger ran all the code up to (but excluding) the line &amp;quot;return success&amp;quot; and stopped.&lt;/p&gt;

&lt;p&gt;Run To Cursor is very useful when it comes to skipping over parts of a function that you don't want to step through. For example, if you have a loop in your method and you don't want to step through the loop, set your cursor just after the loop and select Run To Cursor (CTRL+F10).&lt;/p&gt;

&lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Run To Cursor (CTRL+F10)" border="0" alt="Run To Cursor (CTRL+F10)" src="http://blogs.msdn.com/blogfiles/habibh/WindowsLiveWriter/Debugging101SkippingovercodeintheVisualS_96E7/image_17.png" width="714" height="172" /&gt;&amp;#160; &lt;/p&gt;

&lt;h2&gt;Set Next Statement (CTRL+SHIFT+F10)&lt;/h2&gt;

&lt;p&gt;Set Next Statement is a powerful debugging feature for controlling application execution, granted that it's used correctly. If used incorrectly, it can lead to all sorts of weird and wonderful behavior in your application. In a nutshell, Set Next Statement allows you to jump around in a method &lt;em&gt;without executing any code in between&lt;/em&gt;. In the code segment below, I moved the yellow arrow to the &amp;quot;return success&amp;quot; line which means that I skipped the execution of the &lt;font face="Courier New"&gt;if&lt;/font&gt; statement.&lt;/p&gt;

&lt;p&gt;Set Next Statement is frequently used in conjunction with edit and continue. That is, after changing some code during the debug session, you can set the next statement to the location before the change and re-execute the code to see the affect of your changes.&lt;/p&gt;

&lt;p&gt;Also, instead of using the shortcut CTRL+SHIFT+F10, you can drag the yellow arrow to the location in your code that you want to execute.&lt;/p&gt;

&lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Set Next Statement (CTRL+SHIFT+F10)" border="0" alt="Set Next Statement (CTRL+SHIFT+F10)" src="http://blogs.msdn.com/blogfiles/habibh/WindowsLiveWriter/Debugging101SkippingovercodeintheVisualS_96E7/image_26.png" width="714" height="172" /&gt; &lt;/p&gt;

&lt;p&gt;If you use other techniques to skip over code in the debugger, feel free to leave a comment.&lt;/p&gt;

&lt;p&gt;Habib Heydarian.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9852986" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/habibh/archive/tags/Debugging/default.aspx">Debugging</category><category domain="http://blogs.msdn.com/habibh/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category><category domain="http://blogs.msdn.com/habibh/archive/tags/VSTS+Developing/default.aspx">VSTS Developing</category></item><item><title>Quick Tip: How to move a breakpoint in the Visual Studio debugger</title><link>http://blogs.msdn.com/habibh/archive/2009/07/28/quick-tip-how-to-move-a-breakpoint-in-the-visual-studio-debugger.aspx</link><pubDate>Wed, 29 Jul 2009 04:38:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9851603</guid><dc:creator>habibh</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/habibh/comments/9851603.aspx</comments><wfw:commentRss>http://blogs.msdn.com/habibh/commentrss.aspx?PostID=9851603</wfw:commentRss><description>&lt;p&gt;Setting a breakpoint in the Visual Studio debugger is as simple as placing your cursor on a line of code and pressing F9. However, once you've set the breakpoint, how do you move it to a different location since clicking on the breakpoint will delete it? One workaround is to delete the breakpoint and set a new breakpoint at the new location. The problem is, if you have set a bunch of options on the breakpoint, e.g. a condition, then those options will get lost in the move.&lt;/p&gt;  &lt;p&gt;The trick to moving a breakpoint is to use the &lt;em&gt;Breakpoint Location&lt;/em&gt; option to change the line number of the breakpoint. You can access the Location option by right-clicking on the breakpoint the you want to move and selecting &amp;quot;Location...&amp;quot;, as shown below.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Breakpoint Location" border="0" alt="Breakpoint Location" src="http://blogs.msdn.com/blogfiles/habibh/WindowsLiveWriter/HowtomoveabreakpointintheVisualStudiodeb_10488/image_3.png" width="621" height="201" /&gt; &lt;/p&gt;  &lt;p&gt;On the File Breakpoint dialog, simply change the Line field to the new location and press [OK]. The breakpoint will move to the new location.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="File Breakpoint dialog" border="0" alt="File Breakpoint dialog" src="http://blogs.msdn.com/blogfiles/habibh/WindowsLiveWriter/HowtomoveabreakpointintheVisualStudiodeb_10488/image_6.png" width="505" height="196" /&gt; &lt;/p&gt;  &lt;p&gt;Habib Heydarian.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9851603" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/habibh/archive/tags/Debugging/default.aspx">Debugging</category><category domain="http://blogs.msdn.com/habibh/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category></item><item><title>The Visual Studio Output window: It has more to offer than meets the eye</title><link>http://blogs.msdn.com/habibh/archive/2009/07/22/the-visual-studio-output-window-it-has-more-to-offer-than-meets-the-eye.aspx</link><pubDate>Wed, 22 Jul 2009 14:54:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9844715</guid><dc:creator>habibh</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/habibh/comments/9844715.aspx</comments><wfw:commentRss>http://blogs.msdn.com/habibh/commentrss.aspx?PostID=9844715</wfw:commentRss><description>&lt;p&gt;At first glance, the Visual Studio Output window appears to be a boring tool whose only role in life is to display status information. However, look more closely and you will find that it provides several features that can be extremely useful. Below, I’ve listed the most common scenarios where I use the Output window.&lt;/p&gt;  &lt;h2&gt;Search&lt;/h2&gt;  &lt;p&gt;Probably the most common reason for why I use the Output window is because of search. Not many people know this but you can search the Output window just like any other text editor. To search in the Output window, put your cursor in the window and press CTRL+F. The &lt;strong&gt;Find&lt;/strong&gt; dialog comes up and you can search for any string. Why is this so useful you ask? The main reason is that you can search through output from the compiler, Code Analysis, your own program (think output from Debug.WriteLine) or any other tool that displays its output in the Output window. This basically makes up for not being able to search the Error List.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Output window Search" border="0" alt="Output window Search" src="http://blogs.msdn.com/blogfiles/habibh/WindowsLiveWriter/TheVisualStudioOutputwindowIthasmoretoof_9A42/image_6.png" width="636" height="370" /&gt; &lt;/p&gt;  &lt;h2&gt;Navigation&lt;/h2&gt;  &lt;p&gt;Just like the Error List, you can double-click on an error or warning in the Output window and navigate to it in the source code. There is no visual cue to suggest that you can double-click on a message. You just can!&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Navigation in Output window" border="0" alt="Navigation in Output window" src="http://blogs.msdn.com/blogfiles/habibh/WindowsLiveWriter/TheVisualStudioOutputwindowIthasmoretoof_9A42/image_15.png" width="634" height="230" /&gt; &lt;/p&gt;  &lt;h2&gt;Automatic log file&lt;/h2&gt;  &lt;p&gt;During debugging, since all the output from an application goes to the Output window, I often use the Output window as a log file. Specifically, at the end of the debug session, you can put your cursor in the Output window and press CTRL+S to save the output as a text file. No copy and past required!&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Log File in Output window" border="0" alt="Log File in Output window" src="http://blogs.msdn.com/blogfiles/habibh/WindowsLiveWriter/TheVisualStudioOutputwindowIthasmoretoof_9A42/image_12.png" width="810" height="706" /&gt; &lt;/p&gt;  &lt;p&gt;If you use the Output window for other purposes, feel free to leave me a comment.&lt;/p&gt;  &lt;p&gt;Habib Heydarian.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9844715" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/habibh/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category></item><item><title>How to install and configure the DinnerNow.net 3.0 sample application [Video]</title><link>http://blogs.msdn.com/habibh/archive/2009/07/20/how-to-install-and-configure-the-dinnernow-net-3-0-sample-application-video.aspx</link><pubDate>Mon, 20 Jul 2009 10:02:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9841009</guid><dc:creator>habibh</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/habibh/comments/9841009.aspx</comments><wfw:commentRss>http://blogs.msdn.com/habibh/commentrss.aspx?PostID=9841009</wfw:commentRss><description>&lt;p&gt;About two weeks ago, version 3.0 of the DinnerNow.net sample application was released and I covered the release in this &lt;a href="http://blogs.msdn.com/habibh/archive/2009/07/04/dinnernow-net-3-0-for-visual-studio-2008-sp1-and-net-framework-3-5-sp1-is-here.aspx"&gt;blog&lt;/a&gt;. Since then, there have been close to 800 downloads of the application. To help people ramp up on DinnerNow, I've created a short video that shows how to install and configure DinnerNow.net 3.0.&lt;/p&gt;  &lt;p&gt;There are basically four steps to setup DinnerNow.net 3.0:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Download and install DinnerNow.net &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Configure and Build DinnerNow.net &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; Open the DinnerNow.net solution inside Visual Studio &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Step 4:&lt;/strong&gt; Verify that the DinnerNow application works &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The following video walks through the steps above and discusses the areas to watch out for.&lt;/p&gt; &lt;object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="320" height="240"&gt; &lt;param name="source" value="http://channel9.msdn.com/App_Themes/default/vp09_06_22.xap" /&gt; &lt;param name="initParams" value="m=http://mschnlnine.vo.llnwd.net/d1/ch9/7/2/6/9/7/4/HowToInstallDinnerNow_2MB_ch9.wmv,autostart=false,autohide=true,showembed=true, thumbnail=http://mschnlnine.vo.llnwd.net/d1/ch9/7/2/6/9/7/4/HowToInstallDinnerNow_large_ch9.png, postid=479627" /&gt; &lt;param name="background" value="#00FFFFFF" /&gt; &lt;a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;"&gt; &lt;img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none" /&gt; &lt;/a&gt; &lt;/object&gt;  &lt;p&gt;If you run into any issues installing DinnerNow.net 3.0, feel free to send feedback via the Discussion forum on the &lt;a href="http://dinnernow.codeplex.com/"&gt;DinnerNow&lt;/a&gt; web site.&lt;/p&gt;  &lt;p&gt;Habib Heydarian.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9841009" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/habibh/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category><category domain="http://blogs.msdn.com/habibh/archive/tags/DinnerNow.net/default.aspx">DinnerNow.net</category></item><item><title>Walkthrough: Debug a WPF window or Windows Form without running your application [Video]</title><link>http://blogs.msdn.com/habibh/archive/2009/07/17/walkthrough-debug-a-wpf-window-or-windows-form-without-running-your-application-video.aspx</link><pubDate>Fri, 17 Jul 2009 10:52:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9838406</guid><dc:creator>habibh</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/habibh/comments/9838406.aspx</comments><wfw:commentRss>http://blogs.msdn.com/habibh/commentrss.aspx?PostID=9838406</wfw:commentRss><description>&lt;p&gt;Most Windows GUI applications share a common trait. They all have multiple forms and/or dialogs. In the screenshot below, this simple application alone has four WPF windows.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Solution Explorer showing 4 WPF windows" border="0" alt="Solution Explorer showing 4 WPF windows" src="http://blogs.msdn.com/blogfiles/habibh/WindowsLiveWriter/DebugaWPFwindoworWindowsFormwithoutrunni_FD38/image_3.png" width="313" height="375" /&gt; &lt;/p&gt;  &lt;p&gt;If I want to debug the main window, that's easy. I just press F5 and the main window or form starts up. However, if I want to debug one of windows or dialogs that are displayed as a result of clicking a button in my application, it requires me to i) start my main application and ii) click through various windows and dialogs until I get to the window that I'm interested in.&lt;/p&gt;  &lt;p&gt;This is both tedious and can be time consuming. There is a much easier way to debug a window or form, without having to start the debugger and clicking through the application.&lt;/p&gt;  &lt;p&gt;Watch the video below for a walkthrough.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt; &lt;object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="640" height="480"&gt; &lt;param name="source" value="http://channel9.msdn.com/App_Themes/default/vp09_06_22.xap" /&gt; &lt;param name="initParams" value="m=http://mschnlnine.vo.llnwd.net/d1/ch9/2/0/5/9/7/4/DebugOneForm_2MB_ch9.wmv,autostart=false,autohide=true,showembed=true, thumbnail=http://mschnlnine.vo.llnwd.net/d1/ch9/2/0/5/9/7/4/DebugOneForm_large_ch9.png, postid=479502" /&gt; &lt;param name="background" value="#00FFFFFF" /&gt; &lt;a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;"&gt; &lt;img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none" /&gt; &lt;/a&gt; &lt;/object&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;This feature is available for both C# and VB. Feel free to drop me a line if you are using this feature today.&lt;/p&gt;  &lt;p&gt;Habib Heydarian.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9838406" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/habibh/archive/tags/Debugging/default.aspx">Debugging</category><category domain="http://blogs.msdn.com/habibh/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category></item></channel></rss>