<?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>简单生活 -- Kevin Yang的博客 &#187; 小贴士</title>
	<atom:link href="http://www.imkevinyang.com/tags/%e5%b0%8f%e8%b4%b4%e5%a3%ab/feed" rel="self" type="application/rss+xml" />
	<link>http://www.imkevinyang.com</link>
	<description>It&#039;s all about sharing</description>
	<lastBuildDate>Sun, 05 Feb 2012 15:37:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Visual Studio小贴士&#8212;&#8212;加了Try-Catch也能自动定位到异常代码</title>
		<link>http://www.imkevinyang.com/2009/09/visual-studio%e5%b0%8f%e8%b4%b4%e5%a3%ab%e5%8a%a0%e4%ba%86try-catch%e4%b9%9f%e8%83%bd%e8%87%aa%e5%8a%a8%e5%ae%9a%e4%bd%8d%e5%88%b0%e5%bc%82%e5%b8%b8%e4%bb%a3%e7%a0%81.html</link>
		<comments>http://www.imkevinyang.com/2009/09/visual-studio%e5%b0%8f%e8%b4%b4%e5%a3%ab%e5%8a%a0%e4%ba%86try-catch%e4%b9%9f%e8%83%bd%e8%87%aa%e5%8a%a8%e5%ae%9a%e4%bd%8d%e5%88%b0%e5%bc%82%e5%b8%b8%e4%bb%a3%e7%a0%81.html#comments</comments>
		<pubDate>Fri, 18 Sep 2009 05:07:00 +0000</pubDate>
		<dc:creator>Kevin Yang</dc:creator>
				<category><![CDATA[工具技巧]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[小贴士]]></category>
		<category><![CDATA[异常]]></category>
		<category><![CDATA[断点]]></category>
		<category><![CDATA[调试]]></category>

		<guid isPermaLink="false">http://www.imkevinyang.com/2009/09/visual-studio%e5%b0%8f%e8%b4%b4%e5%a3%ab%e5%8a%a0%e4%ba%86try-catch%e4%b9%9f%e8%83%bd%e8%87%aa%e5%8a%a8%e5%ae%9a%e4%bd%8d%e5%88%b0%e5%bc%82%e5%b8%b8%e4%bb%a3%e7%a0%81.html</guid>
		<description><![CDATA[<p>Visual Studio的调试功能非常强大。当异常发生的时候，能够自动定位到异常发生的地方。但是如果你在代码外层显式的加上了Try-Catch异常捕获的时候，默认情况下，Visual Studio会直接跳到异常处理代码块，而不是出现异常的代码行。</p>
<pre class="csharpcode"><span class="kwrd">namespace</span> BreakOnException
{
    <span class="kwrd">cl&#8230;</span></pre>]]></description>
			<content:encoded><![CDATA[<p>Visual Studio的调试功能非常强大。当异常发生的时候，能够自动定位到异常发生的地方。但是如果你在代码外层显式的加上了Try-Catch异常捕获的时候，默认情况下，Visual Studio会直接跳到异常处理代码块，而不是出现异常的代码行。</p>
<pre class="csharpcode"><span class="kwrd">namespace</span> BreakOnException
{
    <span class="kwrd">class</span> Program
    {
        <span class="kwrd">static</span> <span class="kwrd">void</span> Main(<span class="kwrd">string</span>[] args)
        {
            <span class="kwrd">try</span>
            {
                Program p = <span class="kwrd">null</span>;
                Console.WriteLine(p.GetHashCode());
            }
            <span class="kwrd">catch</span> (System.Exception ex)
            {

            }
        }
    }
}</pre>
<p>上面的代码会抛出经典的NullReferrenceException。但是当你在调试状态下运行时，Visual Studio会将代码停在catch这一行，而不是Console.WriteLine这一行。</p>
<p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.imkevinyang.com/wp-content/uploads/2009/10/image_thumb5.png" width="304" height="116" /> </p>
<p>如果代码简单那倒无所谓，但是假想我们的代码是经过层层的函数调用，最外层却加了这么个Try-Catch，那么异常函数调用内抛出了异常，我们也很难定位到异常出错的代码（StackTrace也只能定位哪一个函数调用出错了）。</p>
<p>这个行为可以通过Debug菜单中的Exception….菜单进行设置。</p>
<p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.imkevinyang.com/wp-content/uploads/2009/10/image_thumb6.png" width="558" height="214" /> </p>
<p>打开此菜单，在CLR异常的Thrown列打上勾，那么以后遇到CLR的异常就不再是定位到用户处理代码了，而是直接停在抛出异常的代码上。这样可以大大方便我们调试程序的Bug。</p>
<p><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.imkevinyang.com/wp-content/uploads/2009/10/image_thumb7.png" width="465" height="151" /> </p>
<p align="right">——<a href="http://www.imkevinyang.com/"><em><strong>Kevin Yang</strong></em></a></p>

	标签：<a href="http://www.imkevinyang.com/tags/tips" title="Tips" rel="tag">Tips</a>, <a href="http://www.imkevinyang.com/tags/visual-studio" title="Visual Studio" rel="tag">Visual Studio</a>, <a href="http://www.imkevinyang.com/tags/%e5%b0%8f%e8%b4%b4%e5%a3%ab" title="小贴士" rel="tag">小贴士</a>, <a href="http://www.imkevinyang.com/categories/techarticles/toolskills-techarticles" title="工具技巧" rel="tag">工具技巧</a>, <a href="http://www.imkevinyang.com/tags/%e5%bc%82%e5%b8%b8" title="异常" rel="tag">异常</a>, <a href="http://www.imkevinyang.com/tags/%e6%96%ad%e7%82%b9" title="断点" rel="tag">断点</a>, <a href="http://www.imkevinyang.com/tags/%e8%b0%83%e8%af%95" title="调试" rel="tag">调试</a><br />

	<h4 style="background-color:#3B3B3B;border-bottom:2px groove gray;color:#F2F2F2;margin-top:20px;padding:6px 6px 6px 15px;margin:20px 0px 0px 0px">你可能对下面的文章感兴趣</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.imkevinyang.com/2009/09/blend%e5%b0%8f%e8%b4%b4%e5%a3%ab%e6%94%b9%e5%8f%98%e9%bc%a0%e6%a0%87%e6%bb%9a%e8%bd%ae%e7%9a%84%e9%bb%98%e8%ae%a4%e8%a1%8c%e4%b8%ba-2.html" title="Blend小贴士&mdash;&mdash;改变鼠标滚轮的默认行为 (2009/09/18)">Blend小贴士&mdash;&mdash;改变鼠标滚轮的默认行为</a> </li>
	<li><a href="http://www.imkevinyang.com/2009/08/firebug%e5%9c%a8edithtml%e6%97%b6%e4%b8%a2%e5%a4%b1%e4%ba%8b%e4%bb%b6%e5%a4%84%e7%90%86%e5%87%bd%e6%95%b0-2.html" title="Firebug在EditHtml时丢失事件处理函数 (2009/08/19)">Firebug在EditHtml时丢失事件处理函数</a> </li>
	<li><a href="http://www.imkevinyang.com/2009/05/javascript%e4%b8%ad%e8%8e%b7%e5%8f%96%e5%87%ba%e9%94%99%e4%bb%a3%e7%a0%81%e6%89%80%e5%9c%a8%e6%96%87%e4%bb%b6%e5%8f%8a%e8%a1%8c%e6%95%b0.html" title="Javascript中获取出错代码所在文件及行数 (2009/05/18)">Javascript中获取出错代码所在文件及行数</a> </li>
	<li><a href="http://www.imkevinyang.com/2011/06/onenote-tips-%e6%b7%b7%e5%90%88%e4%bd%bf%e7%94%a8%e4%b8%ad%e8%8b%b1%e6%96%87%e5%ad%97%e4%bd%93.html" title="OneNote Tips — 混合使用中英文字体 (2011/06/16)">OneNote Tips — 混合使用中英文字体</a> </li>
	<li><a href="http://www.imkevinyang.com/2010/07/sql-tipsupdate%e8%af%ad%e5%8f%a5%e4%b9%9f%e4%bd%bf%e7%94%a8%e8%a1%a8%e5%88%ab%e5%90%8dtable-alias.html" title="Sql Tips——Update语句也使用表别名(Table Alias) (2010/07/02)">Sql Tips——Update语句也使用表别名(Table Alias)</a> </li>
	<li><a href="http://www.imkevinyang.com/2009/09/visual-assist%e4%bb%a3%e7%a0%81%e6%8f%90%e7%a4%ba%e4%bd%bf%e7%94%a8%e7%9a%84%e5%ad%97%e7%ac%a6%e4%b8%b2%e6%a8%a1%e7%b3%8a%e5%8c%b9%e9%85%8d%e7%ae%97%e6%b3%95.html" title="Visual Assist代码提示使用的字符串模糊匹配算法 (2009/09/28)">Visual Assist代码提示使用的字符串模糊匹配算法</a> </li>
	<li><a href="http://www.imkevinyang.com/2010/09/visual-studio-2010%e9%87%8d%e5%91%bd%e5%90%8d%e9%87%8d%e6%9e%84%e6%97%b6%e5%87%ba%e7%8e%b0%e7%9a%84%e9%97%ae%e9%a2%98.html" title="Visual Studio 2010重命名重构时出现的问题 (2010/09/29)">Visual Studio 2010重命名重构时出现的问题</a> </li>
	<li><a href="http://www.imkevinyang.com/2009/05/visual-studio%e7%bb%9f%e8%ae%a1%e6%9c%89%e6%95%88%e4%bb%a3%e7%a0%81%e8%a1%8c%e6%95%b0.html" title="Visual Studio统计有效代码行数 (2009/05/22)">Visual Studio统计有效代码行数</a> </li>
	<li><a href="http://www.imkevinyang.com/2010/07/visual-studio%e7%bc%96%e8%be%91%e5%99%a8%e4%b8%80%e6%ac%a1%e7%bc%a9%e8%bf%9b%e5%8f%8d%e7%bc%a9%e8%bf%9b4%e4%b8%aa%e7%a9%ba%e6%a0%bc.html" title="Visual Studio编辑器一次缩进/反缩进4个空格 (2010/07/04)">Visual Studio编辑器一次缩进/反缩进4个空格</a> </li>
	<li><a href="http://www.imkevinyang.com/2010/05/vs2010%e7%9a%84ui%e8%ae%be%e8%ae%a1%e5%a4%b1%e8%af%af.html" title="VS2010的UI设计失误 (2010/05/31)">VS2010的UI设计失误</a> </li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.imkevinyang.com/2009/09/visual-studio%e5%b0%8f%e8%b4%b4%e5%a3%ab%e5%8a%a0%e4%ba%86try-catch%e4%b9%9f%e8%83%bd%e8%87%aa%e5%8a%a8%e5%ae%9a%e4%bd%8d%e5%88%b0%e5%bc%82%e5%b8%b8%e4%bb%a3%e7%a0%81.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blend小贴士&#8212;&#8212;改变鼠标滚轮的默认行为</title>
		<link>http://www.imkevinyang.com/2009/09/blend%e5%b0%8f%e8%b4%b4%e5%a3%ab%e6%94%b9%e5%8f%98%e9%bc%a0%e6%a0%87%e6%bb%9a%e8%bd%ae%e7%9a%84%e9%bb%98%e8%ae%a4%e8%a1%8c%e4%b8%ba-2.html</link>
		<comments>http://www.imkevinyang.com/2009/09/blend%e5%b0%8f%e8%b4%b4%e5%a3%ab%e6%94%b9%e5%8f%98%e9%bc%a0%e6%a0%87%e6%bb%9a%e8%bd%ae%e7%9a%84%e9%bb%98%e8%ae%a4%e8%a1%8c%e4%b8%ba-2.html#comments</comments>
		<pubDate>Fri, 18 Sep 2009 04:47:00 +0000</pubDate>
		<dc:creator>Kevin Yang</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Blend]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[小贴士]]></category>
		<category><![CDATA[缩放]]></category>
		<category><![CDATA[鼠标滚轮]]></category>

		<guid isPermaLink="false">http://www.imkevinyang.com/2009/10/blend%e5%b0%8f%e8%b4%b4%e5%a3%ab%e6%94%b9%e5%8f%98%e9%bc%a0%e6%a0%87%e6%bb%9a%e8%bd%ae%e7%9a%84%e9%bb%98%e8%ae%a4%e8%a1%8c%e4%b8%ba-2.html</guid>
		<description><![CDATA[<p>使用Blend的一个最大的别扭之处就在于它默认情况下滚轮的作用是放大缩小，而不是我们熟悉的滚动屏幕。还好这个默认行为是可以修改的。在菜单Tool=&#62;Options=&#62;Artboard中找到Mouse Wheel一节，将其改成Ctrl+滚动即可。以后滚轮就是滚动屏幕的作用，Ctrl+滚轮才是&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>使用Blend的一个最大的别扭之处就在于它默认情况下滚轮的作用是放大缩小，而不是我们熟悉的滚动屏幕。还好这个默认行为是可以修改的。在菜单Tool=&gt;Options=&gt;Artboard中找到Mouse Wheel一节，将其改成Ctrl+滚动即可。以后滚轮就是滚动屏幕的作用，Ctrl+滚轮才是缩放。</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Blend 3 Zoom by Mouse Wheel" border="0" alt="Blend 3 Zoom by Mouse Wheel" src="http://www.imkevinyang.com/wp-content/uploads/2009/10/image_thumb4.png" width="226" height="55" /> </p>
<p align="right">——<a href="http://www.imkevinyang.com/"><em><strong>Kevin Yang</strong></em></a></p>

	标签：<a href="http://www.imkevinyang.com/tags/blend" title="Blend" rel="tag">Blend</a>, <a href="http://www.imkevinyang.com/categories/techarticles/silverlight" title="Silverlight" rel="tag">Silverlight</a>, <a href="http://www.imkevinyang.com/tags/silverlight" title="Silverlight" rel="tag">Silverlight</a>, <a href="http://www.imkevinyang.com/tags/tips" title="Tips" rel="tag">Tips</a>, <a href="http://www.imkevinyang.com/tags/%e5%b0%8f%e8%b4%b4%e5%a3%ab" title="小贴士" rel="tag">小贴士</a>, <a href="http://www.imkevinyang.com/tags/%e7%bc%a9%e6%94%be" title="缩放" rel="tag">缩放</a>, <a href="http://www.imkevinyang.com/tags/%e9%bc%a0%e6%a0%87%e6%bb%9a%e8%bd%ae" title="鼠标滚轮" rel="tag">鼠标滚轮</a><br />

	<h4 style="background-color:#3B3B3B;border-bottom:2px groove gray;color:#F2F2F2;margin-top:20px;padding:6px 6px 6px 15px;margin:20px 0px 0px 0px">你可能对下面的文章感兴趣</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.imkevinyang.com/2011/06/onenote-tips-%e6%b7%b7%e5%90%88%e4%bd%bf%e7%94%a8%e4%b8%ad%e8%8b%b1%e6%96%87%e5%ad%97%e4%bd%93.html" title="OneNote Tips — 混合使用中英文字体 (2011/06/16)">OneNote Tips — 混合使用中英文字体</a> </li>
	<li><a href="http://www.imkevinyang.com/2009/02/silverlight-2-rtm-%e5%a4%9a%e5%9b%bd%e8%af%ad%e8%a8%80%e6%94%af%e6%8c%81%ef%bc%88%e5%ba%94%e7%94%a8%e7%a8%8b%e5%ba%8f%e6%9c%ac%e5%9c%b0%e5%8c%96%ef%bc%89.html" title="Silverlight 2 RTM 多国语言支持（应用程序本地化） (2009/02/28)">Silverlight 2 RTM 多国语言支持（应用程序本地化）</a> </li>
	<li><a href="http://www.imkevinyang.com/2009/03/silverlight-2%e5%8a%a8%e6%80%81%e5%8a%a0%e8%bd%bdxap%e5%8c%85%e4%b8%ad%e7%9a%84%e7%a8%8b%e5%ba%8f%e9%9b%86.html" title="Silverlight 2动态加载Xap包中的程序集 (2009/03/02)">Silverlight 2动态加载Xap包中的程序集</a> </li>
	<li><a href="http://www.imkevinyang.com/2010/05/silverlight-4ria-services-%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e4%bc%98%e5%8c%96seo.html" title="Silverlight 4+RIA Services&#8211;搜索引擎优化(SEO) (2010/05/04)">Silverlight 4+RIA Services&#8211;搜索引擎优化(SEO)</a> </li>
	<li><a href="http://www.imkevinyang.com/2009/04/silverlight-seo%ef%bc%88%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e4%bc%98%e5%8c%96%ef%bc%89%e7%99%bd%e7%9a%ae%e4%b9%a6.html" title="Silverlight SEO（搜索引擎优化）白皮书 (2009/04/06)">Silverlight SEO（搜索引擎优化）白皮书</a> </li>
	<li><a href="http://www.imkevinyang.com/2009/03/silverlight2-%e5%8a%a8%e6%80%81%e5%8a%a0%e8%bd%bd%e7%a8%8b%e5%ba%8f%e9%9b%86-ondemand%e6%a8%a1%e5%bc%8fdynamic-load-assembly.html" title="Silverlight2 动态加载程序集&#8212;OnDemand模式(Dynamic Load Assembly) (2009/03/02)">Silverlight2 动态加载程序集&#8212;OnDemand模式(Dynamic Load Assembly)</a> </li>
	<li><a href="http://www.imkevinyang.com/2011/09/silverlight%e4%b8%ad%e6%97%a0%e6%b3%95%e8%ae%be%e7%bd%ae%e5%8d%ab%e6%98%9f%e7%a8%8b%e5%ba%8f%e9%9b%86%e4%b8%ba%e4%b8%ad%e7%ab%8b%e8%b5%84%e6%ba%90%e7%a8%8b%e5%ba%8f%e9%9b%86.html" title="Silverlight中无法设置卫星程序集为中立资源程序集 (2011/09/05)">Silverlight中无法设置卫星程序集为中立资源程序集</a> </li>
	<li><a href="http://www.imkevinyang.com/2010/02/silverlight%e5%90%af%e7%94%a8assembly-caching%e4%b9%8b%e5%90%8e%e9%93%81%e9%80%9a%e7%94%a8%e6%88%b7%e6%97%a0%e6%b3%95%e8%ae%bf%e9%97%ae.html" title="Silverlight启用Assembly Caching之后铁通用户无法访问 (2010/02/13)">Silverlight启用Assembly Caching之后铁通用户无法访问</a> </li>
	<li><a href="http://www.imkevinyang.com/2010/03/silverlight%e7%9a%84%e4%be%9d%e8%b5%96%e5%b1%9e%e6%80%a7%e4%b8%8e%e9%99%84%e5%8a%a0%e5%b1%9e%e6%80%a7.html" title="Silverlight的依赖属性与附加属性 (2010/03/28)">Silverlight的依赖属性与附加属性</a> </li>
	<li><a href="http://www.imkevinyang.com/2010/07/sql-tipsupdate%e8%af%ad%e5%8f%a5%e4%b9%9f%e4%bd%bf%e7%94%a8%e8%a1%a8%e5%88%ab%e5%90%8dtable-alias.html" title="Sql Tips——Update语句也使用表别名(Table Alias) (2010/07/02)">Sql Tips——Update语句也使用表别名(Table Alias)</a> </li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.imkevinyang.com/2009/09/blend%e5%b0%8f%e8%b4%b4%e5%a3%ab%e6%94%b9%e5%8f%98%e9%bc%a0%e6%a0%87%e6%bb%9a%e8%bd%ae%e7%9a%84%e9%bb%98%e8%ae%a4%e8%a1%8c%e4%b8%ba-2.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced

Served from: www.imkevinyang.com @ 2012-02-08 19:31:16 -->
