<?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>Wagner Danda Weblog &#187; .NET</title>
	<atom:link href="http://www.wagnerdanda.me/topics/net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.wagnerdanda.me</link>
	<description>Java, .NET, OpenSource, Web 2.0 and other projects</description>
	<lastBuildDate>Wed, 20 Jan 2010 01:36:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>ASP.NET Ajax Error/Exception Handling &#8211; the simple way</title>
		<link>http://www.wagnerdanda.me/2010/01/asp-net-ajax-updatepanel-error-exception-handling-the-simple-way/</link>
		<comments>http://www.wagnerdanda.me/2010/01/asp-net-ajax-updatepanel-error-exception-handling-the-simple-way/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 01:36:56 +0000</pubDate>
		<dc:creator>Wagner Danda</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[error handling]]></category>
		<category><![CDATA[exception handling]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[UpdatePanel Error Handling]]></category>

		<guid isPermaLink="false">http://www.wagnerdanda.me/?p=134</guid>
		<description><![CDATA[A lot has been said about error/exception handling with ASP.NET Ajax pages, more specifically, how to properly handle and display error messages inside an UpdatePanel. For instance, Scott Gu wrote this sometime ago:
You can now optionally [...] intercept any error message sent back from the server, and perform custom client-side actions as a result [...]. [...]]]></description>
			<content:encoded><![CDATA[<p>A lot has been said about error/exception handling with ASP.NET Ajax pages, more specifically, how to properly handle and display error messages inside an UpdatePanel. For instance, <a href="http://weblogs.asp.net/scottgu/">Scott Gu</a> wrote this sometime ago:</p>
<blockquote><p><em>You can now </em><strong><em>optionally </em></strong><em>[...] intercept any error message sent back from the server, and perform custom client-side actions as a result [...]. (<a href=" http://weblogs.asp.net/scottgu/archive/2006/10/29/tip_2f00_trick_3a00_-handling-errors-with-the-updatepanel-control-using-asp.net-ajax.aspx">source</a></em><em>)</em></p></blockquote>
<p><strong>Well, I disagree with &#8220;optionally&#8221;.</strong> As far as I understand, <strong>if you don&#8217;t explicitly intercept</strong> the error/exception sent back from the server from within an UpdatePanel, your user will get an unfriendly javascript error like this:</p>
<p><a href="http://www.wagnerdanda.me/wp-content/uploads/2010/01/error_on_page1.jpg"><img class="aligncenter size-full wp-image-143" title="asp.net ajax updatepanel error on page message" src="http://www.wagnerdanda.me/wp-content/uploads/2010/01/error_on_page1.jpg" alt="" width="593" height="67" /></a></p>
<p><strong>So what can you do to fix this? </strong>Easy, just add this piece of Javascript code to your Masterpage (or to any page if you don&#8217;t have/use a Masterpage):</p>
<pre class="brush: jscript; highlight: [1,13,19];">
&lt;%-- This script must be placed after the form declaration (i.e. &lt;form id=&quot;form1&quot; runat=&quot;server&quot;&gt;) --%&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
    Sys.Application.add_load(AppLoad);

    function AppLoad() {
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequest);
    }

    function EndRequest(sender, args) {
        // Check to see if there's an error on this request.
        if (args.get_error() != undefined) {

            var msg = args.get_error().message.replace(&quot;Sys.WebForms.PageRequestManagerServerErrorException: &quot;, &quot;&quot;);

            // Show the custom error.
            // Here you can be creative and do whatever you want
            // with the exception (i.e. call a modalpopup and show
            // a nicer error window). I will simply use 'alert'
            alert(msg);

            // Let the framework know that the error is handled,
            //  so it doesn't throw the JavaScript alert.
            args.set_errorHandled(true);
        }
    }
&lt;/script&gt;
</pre>
<p><strong>Now you should get error messages like this (javascript alert): </strong><a href="http://www.wagnerdanda.me/wp-content/uploads/2010/01/ooops_error.jpg"><img class="aligncenter size-full wp-image-162" title="ooops_error" src="http://www.wagnerdanda.me/wp-content/uploads/2010/01/ooops_error.jpg" alt="" width="306" height="193" /></a></p>
<p>This is exactly how exceptions used to be displayed when thrown inside an UpdatePanel before .NET 3.5.</p>
<p><strong>Note: I do understand the benefits of a the new approach</strong>. It gives you flexibility to present the error message any way you want, before your hands where quite tied to this simple Javascript alert window.</p>
<p>As a matter of fact, I&#8217;ve implemented a nice <a href="http://www.asp.net/ajax/ajaxcontroltoolkit/samples/modalpopup/modalpopup.aspx">ModalPopup</a> and have ensure that only user-friendly messages are actually shown: only messages of a certain type (i.e. UIMessageException) are forwarded to the user without any cleanup/transformation.</p>
<p>References:</p>
<ul>
<li><a href="http://www.jankoatwarpspeed.com/post/2008/06/02/Exception-handling-best-practices-in-ASPNET-web-applications.aspx ">Exception handling best practices in ASP.NET web applications</a></li>
<li><a href="http://www.asp.net/(S(ywiyuluxr3qb2dfva1z5lgeg))/learn/ajax-videos/video-9184.aspx">How Do I: Customize Error Handling for the ASP.NET AJAX UpdatePanel</a></li>
<li>MVP blog: <a href="http://msmvps.com/blogs/luisabreu/archive/2006/10/29/UpdatePanel_3A00_-having-fun-with-errors.aspx">UpdatePanel: having fun with errors</a></li>
<li>MSDN post (be careful, not 100% correct): <a href="http://msdn.microsoft.com/en-us/library/bb398934.aspx">Customizing Error Handling for ASP.NET UpdatePanel Controls</a></li>
</ul>
<p>Cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wagnerdanda.me/2010/01/asp-net-ajax-updatepanel-error-exception-handling-the-simple-way/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tip/Trick: How to Show Active File in Solution Explorer (Visual Studio 2008)</title>
		<link>http://www.wagnerdanda.me/2009/12/tiptrick-how-to-show-active-file-in-solution-explorer-visual-studio-2008/</link>
		<comments>http://www.wagnerdanda.me/2009/12/tiptrick-how-to-show-active-file-in-solution-explorer-visual-studio-2008/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 23:24:16 +0000</pubDate>
		<dc:creator>Wagner Danda</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[tip/trick]]></category>
		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://www.wagnerdanda.me/?p=125</guid>
		<description><![CDATA[Many thanks to &#8220;Ronald Widha&#8221; by blogging about this Visual Studio simple trick that allows you to show the active files in Visual Studio (one little feature that I use a lot when working with Eclipse):
One of the most annoying thing about Visual Studio default settings is the fact that the Solution Explorer doesn’t track [...]]]></description>
			<content:encoded><![CDATA[<p>Many thanks to &#8220;<a href="http://www.ronaldwidha.net/">Ronald Widha</a>&#8221; by blogging about this Visual Studio simple trick that allows you to show the active files in Visual Studio (one little feature that I use a lot when working with Eclipse):</p>
<blockquote><p><em>One of the most annoying thing about Visual Studio default settings is the fact that the Solution Explorer doesn’t track what files you are currently looking at. Alot of developers thought this was the only way, and had to bear the pain of flicking through the Solution Explorer while scratching their head to figure out ‘where the hell I put this file?’.</em></p>
<p><em>There is actually a setting in Visual Studio that does this automatically.</em></p>
<p><strong><em>Tools – Options – Projects and Solutions – Track Active Item</em></strong><em> in Solution Explorer</em></p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 108px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><em>There is actually a setting in Visual Studio that does this automatically.</em></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 108px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><em>Tools – Options – Projects and Solutions – Track Active Item in Solution Explorer</em></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 108px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><em>Just tick the box..and you’re all set!</em></div>
<p><em>Just tick the box..and you’re all set!</em></p>
<p>source: <a href="http://www.ronaldwidha.net/2008/11/26/visual-studio-show-active-file-in-solution-explorer/">http://www.ronaldwidha.net/2008/11/26/visual-studio-show-active-file-in-solution-explorer/</a></p></blockquote>
<p>Thanks Ronald!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wagnerdanda.me/2009/12/tiptrick-how-to-show-active-file-in-solution-explorer-visual-studio-2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.NET Development server slow on Windows Vista/7 with Firefox or Chrome</title>
		<link>http://www.wagnerdanda.me/2009/12/asp-net-development-server-slow-on-windows-vista7-with-firefox-or-chrome/</link>
		<comments>http://www.wagnerdanda.me/2009/12/asp-net-development-server-slow-on-windows-vista7-with-firefox-or-chrome/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 00:19:52 +0000</pubDate>
		<dc:creator>Wagner Danda</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Disable IPv6]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Google Chrome]]></category>
		<category><![CDATA[IPV6]]></category>
		<category><![CDATA[slow]]></category>
		<category><![CDATA[Visual Studio ASP.NET development server]]></category>
		<category><![CDATA[Windows Vista]]></category>

		<guid isPermaLink="false">http://www.wagnerdanda.me/?p=101</guid>
		<description><![CDATA[While developing an ASP.NET website running it on the Visual Studio ASP.NET development server I was noticing that page loads exceedingly slowly in Firefox and Google Chrome after upgrading to Windows 7 (same issue occurs with Windows Vista). 
A page refresh would usually take up to 3 seconds (localhost) even without changing the source code [...]]]></description>
			<content:encoded><![CDATA[<p><strong>While developing an ASP.NET website running it on the Visual Studio ASP.NET development server I was noticing that page loads exceedingly slowly in Firefox and Google Chrome after upgrading to Windows 7 (same issue occurs with Windows Vista). </strong></p>
<p>A page refresh would usually take up to 3 seconds (localhost) even without changing the source code (so it should be instantaneously, especially now that I&#8217;m using a SSD).</p>
<p>It appears that there is some kind of <a href="http://weblogs.asp.net/dwahlin/archive/2007/06/17/fixing-firefox-slowness-with-localhost-on-vista.aspx">bug on Vista/Windows 7 with DSN and IPv6</a>, but that can be easily fixed. Here are some of the solutions I have found:</p>
<p><strong>1. </strong><strong>Recommended Solution &#8211; machine wide</strong>: uncomment the localhost address in the hosts file (%WINDIR%\System32\drivers\etc\hosts): (<a href="http://stackoverflow.com/questions/1628793/setting-up-iis7-5-for-local-asp-net-development">source</a>)</p>
<blockquote><p># localhost name resolution is handled within DNS itself.</p>
<p><span style="white-space: pre;"> </span>127.0.0.1       localhost</p>
<p>#<span style="white-space: pre;"> </span>::1             localhost</p></blockquote>
<blockquote>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 153px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># localhost name resolution is handled within DNS itself.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 153px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>127.0.0.1       localhost</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 153px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">#<span style="white-space: pre;"> </span>::1             localhost</div>
</blockquote>
<p><strong>2. </strong>Firefox-only solution: <a href="http://accidentaltechnologist.com/asp-net/aspnet-development-server-problems-under-vista/">disable IPv6</a></p>
<blockquote><p>1. Type about:config in the address bar and press Enter.</p>
<p>2. Scroll down until you find network.dns.disableIPv6.</p>
<p>3. Double-click on it to change its value to true.</p>
<p>4. Restart Firefox.</p></blockquote>
<p><strong>3. </strong>System wide-configuration (option 1):<strong> </strong><a href="http://www.windowsreference.com/networking/disable-ipv6-random-identifier-in-windows-7-server-2008-vista/">Disable IPv6 Random identifier</a></p>
<blockquote><p>netsh interface tcp set global autotuninglevel=disabled</p></blockquote>
<p><strong>4.<span style="font-weight: normal;"><strong> </strong>System wide-configuration (option 2): <a href="http://www.tech-faq.com/how-do-i-remove-ipv6-in-vista.shtml">Disable IPv6 from Your LAN Interfaces and Connections</a></span></strong></p>
<blockquote><p>1. Launch Vista, click on Start, and then click on Run. Once the Run window appears, type regedit.</p>
<p>2. Once you have accessed the registry, you will add a registry value as follows: (DWORD type) Set to OxFF.</p>
<p>3. The registry is as follows: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters\DisabledComponents</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.wagnerdanda.me/2009/12/asp-net-development-server-slow-on-windows-vista7-with-firefox-or-chrome/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Speeding up build times in ASP.NET with RamDisk</title>
		<link>http://www.wagnerdanda.me/2009/11/speeding-up-build-times-in-asp-net-with-ramdisk/</link>
		<comments>http://www.wagnerdanda.me/2009/11/speeding-up-build-times-in-asp-net-with-ramdisk/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 19:50:23 +0000</pubDate>
		<dc:creator>Wagner Danda</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Build]]></category>
		<category><![CDATA[ramdisk]]></category>
		<category><![CDATA[slow build]]></category>
		<category><![CDATA[speed up]]></category>
		<category><![CDATA[Temporary ASP.NET Files]]></category>

		<guid isPermaLink="false">http://www.wagnerdanda.me/?p=40</guid>
		<description><![CDATA[Here is another quick tip on how to speed up build times on your ASP.NET website projects: create a ram-based drive (i.e. using RamDisk) and change your default &#8220;Temporary ASP.NET Files&#8221; to this memory-based drive.
Then every time you change your ASP.NET pages (or any code-behind or reference DLLs) the build will happen much faster because [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Here is another quick tip on how to </strong><strong>speed up build times on your ASP.NET website projects</strong>:<strong> </strong>create a<strong> ram-based drive</strong> (i.e. using RamDisk) and change your default &#8220;<strong>Temporary ASP.NET Files</strong>&#8221; to this memory-based drive.</p>
<p>Then every time you change your ASP.NET pages (or any code-behind or reference DLLs) the build will happen much faster because is doing all in memory.</p>
<p>So, how you do this? Simply follow these steps:</p>
<p><strong>1) Make sure you have enough free memory</strong>:</p>
<p>Open the usual apps you use (i.e. Visual Studio, Outlook, etc) and check how much free memory you have (Task Manager -&gt; Performance -&gt; Physical Memory -&gt; Available).</p>
<p>So, let&#8217;s say you have 500MB free and your total memory physical memory is 2GB (Task Manager -&gt; Performance -&gt; Physical Memory -&gt; Total).  The total I&#8217;d recommend allocating for your virtual drive would be half of your free memory, or 250MB.</p>
<p>If you&#8217;re short on free memory, try running some cleanup tools like <a href="http://www.tune-up.com/products/tuneup-utilities/">TuneUp Utilities</a> (very good, but paid) or <a href="http://www.ccleaner.com/">CCleaner </a>(free). Besides that, you can always check what services are running and stop/disable the ones you really don&#8217;t need (this is a delicate step, be careful not to stop essential services &#8211; use Google to find out what&#8217;s essential and what&#8217;s not).</p>
<p><strong>2) Install RamDisk</strong></p>
<p>I&#8217;m using a free implementation that can be found <a href="http://depositfiles.com/files/916161">here</a>. You can follow <a href="http://www.mydigitallife.info/2007/05/27/free-ramdisk-for-windows-vista-xp-2000-and-2003-server/">these</a> steps for a details explanation of this tool and installation instructions.</p>
<p>Make sure you install it and create a drive letter (i.e. &#8220;R:&#8221;) with the disk size amount calculated in the previous step. If you over-allocate it, your Windows will run out of memory and the whole purpose of this idea will be worthless.</p>
<p><strong>3) Change your default &#8220;Temporary ASP.NET Files&#8221; folder to your new ram-based drive</strong></p>
<p>Here you have two options. You can do this only for a specific site or for all projects running on your computer. If you have too many sites you may run out of disk space in your ramdisk, so choose your option wisely <img src='http://www.wagnerdanda.me/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p><em>3.1) Configuration for a specific website (local settings):</em></p>
<p>Change your site&#8217;s web.config &#8220;compilation&#8221; property to specify the new path. Below is an example that assumes &#8220;R:\ASP_NET_TempFiles\&#8221; as the new ram-based folder location:</p>
<p><code>&lt;system.web&gt;<br />
....<br />
&lt;compilation debug="true" <strong>tempDirectory="R:\ASP_NET_TempFiles\"</strong>&gt;<br />
....<br />
&lt;/compilation&gt;<br />
....<br />
&lt;/system.web&gt;<br />
</code></p>
<p><em>3.2) Configuration for all ASP.net websites (global settings):</em></p>
<p>To implement this globally all you need to do is change your global web.config (which is usually located somewhere like this C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\web.config)and  adjust the compilation properties the same way the local settings (previous example):</p>
<p><code>&lt;system.web&gt;<br />
....<br />
&lt;compilation debug="true" <strong>tempDirectory="R:\ASP_NET_TempFiles\"</strong>&gt;<br />
....<br />
&lt;/compilation&gt;<br />
....<br />
&lt;/system.web&gt;</code></p>
<p><strong>And your done!</strong></p>
<p><strong>Two last tips I can give you is </strong>to keep an eye on the usage of your ramdisk folder. If it get&#8217;s full, you&#8217;ll have to manually delete some old temporary files. <strong> The second tip is</strong> to watch how your free memory, if it gets too close to it&#8217;s total it might indicate the you either have too much programs running or you might have to reduce your ramdisk size.</p>
<p><strong>Happy speed building! <img src='http://www.wagnerdanda.me/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wagnerdanda.me/2009/11/speeding-up-build-times-in-asp-net-with-ramdisk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tip/Trick: Optimizing ASP.NET Build Time with Dynamic Compilation (optimizeCompilations=&#8221;true&#8221;)</title>
		<link>http://www.wagnerdanda.me/2009/11/optimizing-asp-net-build-time-with-dynamic-compilation-and-optimizecompilations/</link>
		<comments>http://www.wagnerdanda.me/2009/11/optimizing-asp-net-build-time-with-dynamic-compilation-and-optimizecompilations/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 21:50:14 +0000</pubDate>
		<dc:creator>Wagner Danda</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Build]]></category>
		<category><![CDATA[Dynamic Compilation]]></category>
		<category><![CDATA[optimizeCompilations]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.wagnerdanda.me/?p=23</guid>
		<description><![CDATA[If you are experiencing slow builds with ASP.NET projects or want to learn how to speed them up please read on.
Microsoft has introduced a new optimizeCompilations switch in ASP.NET that can greatly improve the compilation speed in some scenarios. You can read this blog post to understand the overall idea, study a more detailed explanation about [...]]]></description>
			<content:encoded><![CDATA[<p><strong>If you are experiencing slow builds with ASP.NET projects or want to learn how to speed them up please read on.</strong></p>
<p>Microsoft has introduced a new optimizeCompilations switch in ASP.NET that can greatly improve the compilation speed in some scenarios. You can read <a href="http://blogs.msdn.com/davidebb/archive/2009/04/15/a-new-flag-to-optimize-asp-net-compilation-behavior.aspx">this</a> blog post to understand the overall idea, study a more detailed explanation about Dynamic Compilation <a href="http://msdn.microsoft.com/en-us/library/ms366723.aspx">here</a> <strong>or</strong> <strong>simply follow these 2 easy steps:</strong></p>
<p><strong>1) Install this hot-fix:</strong></p>
<ul>
<li>Windows XP: <a title="http://code.msdn.microsoft.com/KB969612" href="http://code.msdn.microsoft.com/KB969612/Release/ProjectReleases.aspx?ReleaseId=2582">http://code.msdn.microsoft.com/KB969612</a></li>
<li>Windows Vista: <a href="http://code.msdn.microsoft.com/KB967535/Release/ProjectReleases.aspx?ReleaseId=2328">http://code.msdn.microsoft.com/KB967535</a></li>
<li>Windows 7 &#8211; not necessary</li>
</ul>
<p><strong>2) Update your web.config as follows:</strong></p>
<p>Add <em>optimizeCompilations=&#8221;true&#8221;</em> to your &lt;<em>compilation</em> &#8230;&gt; tag. Below is an example:</p>
<p><code>&lt;system.web&gt;<br />
....<br />
&lt;compilation debug="true" <strong>optimizeCompilations="true"</strong>&gt;<br />
....<br />
&lt;/compilation&gt;<br />
....<br />
&lt;/system.web&gt;<br />
</code></p>
<p><strong>And you&#8217;re done! </strong>Next time you change something inside the <em>App_code</em> or even a <em>dll</em> inside the <em>bin</em> folder you might not have to wait the entire site to rebuild.</p>
<p><strong>Important note: this approach speeds things up but you might get some weird errors when you start changing some code signatures or restructuring dlls.</strong>In this case, all you need to do is a simple &#8220;rebuild project/solution&#8221; inside your Visual Studio to get things straight again.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wagnerdanda.me/2009/11/optimizing-asp-net-build-time-with-dynamic-compilation-and-optimizecompilations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Deploy an ASP.NET web application using Team Foundation Server</title>
		<link>http://www.wagnerdanda.me/2009/09/how-to-deploy-an-asp-net-web-application-using-team-foundation-server/</link>
		<comments>http://www.wagnerdanda.me/2009/09/how-to-deploy-an-asp-net-web-application-using-team-foundation-server/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 18:16:51 +0000</pubDate>
		<dc:creator>Wagner Danda</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[TFS]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Build]]></category>
		<category><![CDATA[ISS]]></category>

		<guid isPermaLink="false">http://www.wagnerdanda.me/?p=9</guid>
		<description><![CDATA[Here is a quick tip on how to modify a TFS build script to publish an ASP.NET site to an existing IIS server (i.e. development environment).
Sample Code
Assuming you have created your basic TFSBuild.proj file, add this to the bottom of the file (right before the &#60;/project&#62; tag):

&#60;!&#8211; This task will be executed after the build [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a quick tip on how to modify a TFS build script to publish an ASP.NET site to an existing IIS server (i.e. development environment).</p>
<p><strong>Sample Code</strong></p>
<p>Assuming you have created your basic TFSBuild.proj file, add this to the bottom of the file (right before the &lt;/project&gt; tag):<br />
<span style="font-size: xx-small;"><em><br />
&lt;!&#8211; This task will be executed after the build is copied to the drop location (i.e. build storage) and<br />
will take care of automating the deployment of the project to an IIS folder<br />
by &#8216;Wagner Danda da Silva&#8217;<br />
&#8211;&gt;<br />
&lt;Target Name=&#8221;AfterDropBuild&#8221; Condition=&#8221; &#8216;$(BuildBreak)&#8217;!=&#8217;true&#8217; &#8220;&gt;</em></span></p>
<p><span style="font-size: xx-small;"><em>&lt;!&#8211; Let&#8217;s prepare the copy by setting the drop location (IIS website folder) ** &#8211;&gt;<br />
&lt;CreateProperty Value=&#8221;<strong><em>\\dswebdev\QA\</em></strong>&#8220;&gt; &lt;!&#8211; replace this with your IIS folder &#8211;&gt;<br />
&lt;Output TaskParameter=&#8221;Value&#8221; PropertyName=&#8221;MyDropLocation&#8221;/&gt;<br />
&lt;/CreateProperty&gt;</p>
<p>&lt;!&#8211; The path below is where the sources can be found after building ASP.NET projects, you probably won&#8217;t need to edit this. &#8211;&gt;<br />
&lt;CreateItem Include=&#8221;$(DropLocation)\$(BuildNumber)\%(ConfigurationToBuild.FlavorToBuild)\_PublishedWebsites\Web\<strong> </strong>\*&#8221;&gt;<br />
&lt;Output TaskParameter=&#8221;Include&#8221; ItemName=&#8221;MyDropFiles&#8221;/&gt;<br />
&lt;/CreateItem&gt;</p>
<p>&lt;!&#8211; Let&#8217;s remove any pre-deployed files. This will delete any existing files inside all folder and subfolders of the drop location. I opted not to use the default TFS delete task because that was removing security permission on my folders and messing up with my build. The command below won&#8217;t do that, will simply delete old files (but it won&#8217;t remove the folders, so if you deleted a folder on your source code you&#8217;ll have to manually remove it from the drop location &#8211; if you actually care for that <img src='http://www.wagnerdanda.me/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  &#8211;&gt;<br />
&lt;Exec Command=&#8217;del /f /s /q $(MyDropLocation)\*&#8217;/&gt;</p>
<p>&lt;!&#8211; Copy the files from the build drop location to the IIS website folder &#8211;&gt;<br />
&lt;Exec Command=&#8217;xcopy /Y /R /E &#8220;$(DropLocation)\$(BuildNumber)\%(ConfigurationToBuild.FlavorToBuild)\_PublishedWebsites\Web\<strong>.</strong>&#8221; &#8220;$(MyDropLocation)\<strong>.</strong>&amp;quot;&#8217; /&gt;</p>
<p></em></span></p>
<p><span style="font-size: xx-small;"><em>&lt;/Target&gt;<br />
</em></span></p>
<p>More details can be found here:<a href="http://tfsdeploy2iis.codeplex.com/">http://tfsdeploy2iis.codeplex.com/</a></p>
<p><strong><br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wagnerdanda.me/2009/09/how-to-deploy-an-asp-net-web-application-using-team-foundation-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
