<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Stephen Wright</title><link>http://devlicio.us/blogs/steve_wright/default.aspx</link><description>Just another programmer</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/StephenWright" /><feedburner:info uri="stephenwright" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><title>ASP.NET + StructureMap = Epic Win</title><link>http://feedproxy.google.com/~r/StephenWright/~3/IohES3KsuFg/asp-net-structuremap-epic-win.aspx</link><pubDate>Thu, 26 Nov 2009 04:51:03 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:54138</guid><dc:creator>Stephen Wright</dc:creator><slash:comments>8</slash:comments><wfw:commentRss>http://devlicio.us/blogs/steve_wright/rsscomments.aspx?PostID=54138</wfw:commentRss><comments>http://devlicio.us/blogs/steve_wright/archive/2009/11/25/asp-net-structuremap-epic-win.aspx#comments</comments><description>&lt;p&gt;After running into a lot of testing problems with my current architecture in ASP.NET, I decided that it was time to look into an IoC Framework.&amp;#160; I have heard the marvels of how it makes code so much more isolated and clean (SOLID), but I couldn’t see my code ever getting to this point.&amp;#160; Because this project has a ton of legacy code, there was little incentive to add anything else when it was already so highly coupled.&amp;#160; I needed to take a step back and look at it from a different perspective.&lt;/p&gt;  &lt;p&gt;I understood how IoC (Inversion of Control) Frameworks worked and knew how this technique is used, but I didn’t know how I could integrate it in my application.&amp;#160; Most of my action/service methods were static classes that instantiated new objects to return what I needed.&lt;/p&gt;  &lt;p&gt;Here’s an example:&lt;/p&gt;  &lt;p&gt;On the member page, there is a list of upcoming conferences that calls this code:&lt;/p&gt;  &lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:dd8e0eb7-bfc4-40a2-9e1a-3a86746397ff" class="wlWriterEditableSmartContent"&gt;&lt;pre name="code" class="vb"&gt;Public Class ConferenceService    

	Public Shared Function GetUpcomingConferences(ByVal DisplayDate As DateTime) As IList(Of ConferenceEntity)        
		Using repo As New Repository            
			Dim bucket As New RelationPredicateBucket(ConferenceFields.IsActive = True)
            Dim startfilter As New PredicateExpression(ConferenceFields.StartDisplayDate = System.DBNull.Value)            
			startfilter.AddWithOr(ConferenceFields.StartDisplayDate &amp;lt;= DisplayDate)    
			bucket.PredicateExpression.AddWithAnd(startfilter)         

			Dim endfilter As New PredicateExpression(ConferenceFields.EndDisplayDate = System.DBNull.Value)   
			endfilter.AddWithOr(ConferenceFields.EndDisplayDate &amp;gt;= DisplayDate)           
			bucket.PredicateExpression.AddWithAnd(endfilter)          
			Dim sorter As New SortExpression(ConferenceFields.StartDateTimeUtc Or SortOperator.Ascending)    
			Return repo.GetCollection(Of ConferenceEntity)(bucket, sorter).ToList()    
		End Using   
	End Function
	
End Class&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I am using LLBLGen (Adapter) as my DAL so the Repository class is responsible for calling a new object to create what LLBLGen calls an EntityCollection.&amp;#160; This is easy to call because all I have to do is call ConferenceService.GetUpcomingConferences(Date.Now()) to get a list of upcoming conference.&amp;#160; This is very hard to test though without using something like Typemock.&lt;/p&gt;

&lt;p&gt;In order to start my refactoring to be able to integrate StructureMap, I needed to look at how my ConferenceService was being constructed.&amp;#160; There are 5 constructor calls in this method alone. You can imagine how the rest of the application looks like.&lt;/p&gt;

&lt;h3&gt;Adding and Setting Up StructureMap&lt;/h3&gt;

&lt;p&gt;First, download StructureMap from the website.&amp;#160; I downloaded version 2.5.3.&amp;#160; Next was to look how to get StructureMap set up on the web project (found here &lt;a title="http://structuremap.sourceforge.net/ConfiguringStructureMap.htm" href="http://structuremap.sourceforge.net/ConfiguringStructureMap.htm"&gt;http://structuremap.sourceforge.net/ConfiguringStructureMap.htm&lt;/a&gt;).&amp;#160; I had to use for VB and lambdas are tricky so this is how the Bootstrapper was defined:&lt;/p&gt;

&lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:312acba2-65a4-4d31-ab1f-e9a77644cf45" class="wlWriterEditableSmartContent"&gt;&lt;pre name="code" class="vb"&gt;Imports StructureMap
Imports StructureMap.Configuration.DSL

Public Class Bootstrapper    
	
	Public Shared Sub BootstrapStructureMap()        
		ObjectFactory.Initialize(AddressOf ConfigStructureMap)    
	End Sub    

	Private Shared Sub ConfigStructureMap(ByVal x As IInitializationExpression)        
		x.AddRegistry(New RepositoryRegistry)    
	End Sub    
	
	Public Class RepositoryRegistry       
		Inherits Registry        
		
		Overrides Protected Sub configure()   
			&amp;#39;Will be used later after we refactor      
			&amp;#39;ForRequestedType(Of IRepository)().TheDefaultIsConcreteType(Of Repository)().CacheBy(Attributes.InstanceScope.Hybrid)   
		End Sub   
		
	 End Class
 End Class&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;And then, in our Global.asax, on the Application_Start, call the Bootstrapper.BootstrapStructureMap() method. That is all we need for StructureMap config for now.&amp;#160; That will get us started in the right direction.&lt;/p&gt;

&lt;h3&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;margin-left:0px;border-left-width:0px;margin-right:0px;" title="image" border="0" alt="image" align="right" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/steve_5F00_wright/image_5F00_47823835.png" width="349" height="168" /&gt;Refactoring&lt;/h3&gt;

&lt;p&gt;The first refactoring is to Extract an Interface from the Repository class.&amp;#160; If you have a refactoring tool such as Refactor Pro! or Resharper, this is made very easy.&amp;#160; I called mine, &lt;strong&gt;IRepository&lt;/strong&gt;.&amp;#160; This will make the Repository class implement the newly created interface.&amp;#160; We can now start on the ConferenceService.&lt;/p&gt;

&lt;p&gt;The next refactoring is to create a constructor for the ConferenceService class that takes an IRepository as a parameter.&amp;#160; This will help us create Constructor Injection.&lt;/p&gt;

&lt;p&gt;After we add the parameter, we can remove the code that uses the concrete Repository object.&lt;/p&gt;

&lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:911bc65d-9db6-49a3-9ee0-90eaadcc3999" class="wlWriterEditableSmartContent"&gt;&lt;pre name="code" class="vb"&gt; Public Class ConferenceService   
	 
	 Private _repo As IRepository    
	 &amp;#39;&amp;#39;&amp;#39; &amp;lt;summary&amp;gt;    
	 &amp;#39;&amp;#39;&amp;#39; Initializes a new instance of the ConferenceService class.    
	 &amp;#39;&amp;#39;&amp;#39; &amp;lt;/summary&amp;gt;    
	 &amp;#39;&amp;#39;&amp;#39; &amp;lt;param name=&amp;quot;repo&amp;quot;&amp;gt;&amp;lt;/param&amp;gt;    
	 Public Sub New(ByVal repo As IRepository)        
		_repo = repo    
	 End Sub    
	 
	 Public Function GetUpcomingConferences(ByVal DisplayDate As DateTime) As IList(Of ConferenceEntity)        
		 Dim bucket As New RelationPredicateBucket(ConferenceFields.IsActive = True)        
		 im startfilter As New PredicateExpression(ConferenceFields.StartDisplayDate = System.DBNull.Value)        
		 startfilter.AddWithOr(ConferenceFields.StartDisplayDate &amp;lt;= DisplayDate)        
		 bucket.PredicateExpression.AddWithAnd(startfilter)        
		 Dim endfilter As New PredicateExpression(ConferenceFields.EndDisplayDate = System.DBNull.Value)        
		 endfilter.AddWithOr(ConferenceFields.EndDisplayDate &amp;gt;= DisplayDate)        
		 bucket.PredicateExpression.AddWithAnd(endfilter)        
		 Dim sorter As New SortExpression(ConferenceFields.StartDateTimeUtc Or SortOperator.Ascending)        
		 Return _repo.GetCollection(Of ConferenceEntity)(bucket, sorter).ToList()            
	End Function   
	
 End Class&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The next piece of code is back in our Bootstrapper that we have to uncomment.&amp;#160; &lt;/p&gt;

&lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:4dacc245-a5fb-4b5d-8a33-0b609a3d5f05" class="wlWriterEditableSmartContent"&gt;&lt;pre name="code" class="vb"&gt;&amp;#39;ForRequestedType(Of IRepository)().TheDefaultIsConcreteType(Of Repository)().CacheBy(Attributes.InstanceScope.Hybrid) 
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now, instead of calling the static method as such:&lt;/p&gt;

&lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:d4be5757-b5d9-4433-ae7e-fae58e8a1e02" class="wlWriterEditableSmartContent"&gt;&lt;pre name="code" class="vb"&gt;Dim upcomingConf as IList(Of ConferenceEntity) = ConferenceService.GetUpcomingConferences(Date.Now())&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;We can call it as such:&lt;/p&gt;

&lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:0a87f121-4797-4ecb-9569-309eafd5e8b5" class="wlWriterEditableSmartContent"&gt;&lt;pre name="code" class="vb"&gt;Dim upcomingConf as IList(Of ConferenceEntity) = new ConferenceService(ObjectFactory.GetInstance(Of IRepository)()).GetUpcomingConferences(Date.Now())&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This allows us to decouple the concrete Repository object and allows for testing out our method. We’ll be able to write tests now to cover our legacy code, and allow for more flexible code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=54138" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/StephenWright/~4/IohES3KsuFg" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/steve_wright/archive/tags/ASP.NET/default.aspx">ASP.NET</category><feedburner:origLink>http://devlicio.us/blogs/steve_wright/archive/2009/11/25/asp-net-structuremap-epic-win.aspx</feedburner:origLink></item><item><title>FitNesse with Bob Martin – Part 2</title><link>http://feedproxy.google.com/~r/StephenWright/~3/4m0tCwQ9C5U/fitnesse-with-bob-martin-part-2.aspx</link><pubDate>Mon, 04 May 2009 00:48:46 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:46468</guid><dc:creator>Stephen Wright</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://devlicio.us/blogs/steve_wright/rsscomments.aspx?PostID=46468</wfw:commentRss><comments>http://devlicio.us/blogs/steve_wright/archive/2009/05/03/fitnesse-with-bob-martin-part-2.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://www.viddler.com/explore/underwhelmed/videos/2/"&gt;Here is the second part of the meeting&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=46468" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/StephenWright/~4/4m0tCwQ9C5U" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/steve_wright/archive/tags/TDD/default.aspx">TDD</category><feedburner:origLink>http://devlicio.us/blogs/steve_wright/archive/2009/05/03/fitnesse-with-bob-martin-part-2.aspx</feedburner:origLink></item><item><title>FitNesse with Bob Martin – Part 1</title><link>http://feedproxy.google.com/~r/StephenWright/~3/6vgDI0AXo7Y/fitnesse-with-bob-martin-part-1.aspx</link><pubDate>Sat, 11 Apr 2009 05:55:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:45902</guid><dc:creator>Stephen Wright</dc:creator><slash:comments>1</slash:comments><wfw:commentRss>http://devlicio.us/blogs/steve_wright/rsscomments.aspx?PostID=45902</wfw:commentRss><comments>http://devlicio.us/blogs/steve_wright/archive/2009/04/11/fitnesse-with-bob-martin-part-1.aspx#comments</comments><description>&lt;p&gt;On Wednesday, Uncle Bob Martin came out to the Chicago ALT.NET meeting to demo FitNesse. &lt;a href="http://www.viddler.com/explore/underwhelmed/videos/1/"&gt;Here is Part 1 of the meeting&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=45902" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/StephenWright/~4/6vgDI0AXo7Y" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/steve_wright/archive/tags/TDD/default.aspx">TDD</category><feedburner:origLink>http://devlicio.us/blogs/steve_wright/archive/2009/04/11/fitnesse-with-bob-martin-part-1.aspx</feedburner:origLink></item><item><title>Typemock NUnit Results to TeamCity</title><link>http://feedproxy.google.com/~r/StephenWright/~3/rbjSNMwvc1s/typemock-nunit-results-to-teamcity.aspx</link><pubDate>Sun, 01 Mar 2009 20:16:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:44742</guid><dc:creator>Stephen Wright</dc:creator><slash:comments>3</slash:comments><wfw:commentRss>http://devlicio.us/blogs/steve_wright/rsscomments.aspx?PostID=44742</wfw:commentRss><comments>http://devlicio.us/blogs/steve_wright/archive/2009/03/01/typemock-nunit-results-to-teamcity.aspx#comments</comments><description>&lt;p&gt;I’ve been using &lt;a href="http://www.jetbrains.com/teamcity"&gt;TeamCity&lt;/a&gt; for project builds for about 6 months now, but I haven’t used it to it’s full potential as a build server.&amp;nbsp; I couldn’t get &lt;a href="http://www.typemock.com/"&gt;Typemock&lt;/a&gt; to run properly on Team City.&amp;nbsp; I decided to take a look on how to do this.&amp;nbsp; I thought it would be easy to do using TeamCity.&amp;nbsp; However, according to the Typemock documentation, we have to use the &amp;lt;exec&amp;gt; command instead of the build in &amp;lt;nunit2&amp;gt; command, which makes this process a lot more involved.&lt;/p&gt;  &lt;p&gt;I also wanted to get the NUnit console to return the number of tests that had passed and which tests had failed, as such:&lt;/p&gt;  &lt;p&gt;&lt;img src="http://devlicio.us/blogs/steve_wright/20090301_1347_265EF52A.png" title="2009-03-01_1347" style="border-width:0px;display:inline;" alt="2009-03-01_1347" width="579" border="0" height="55" /&gt; &lt;/p&gt;  &lt;p&gt;Here’s how I did it.&amp;nbsp; For this project, I am using the following:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;TeamCity Professional 4.0.2, build 8222 &lt;/li&gt;    &lt;li&gt;Typemock Isolator 5.2.2 x64 &lt;/li&gt;    &lt;li&gt;NUnit 2.4.6 x64 &lt;/li&gt;    &lt;li&gt;NAnt 0.86 Beta (nightly build from 1/30/2009, 0.86.3317.0) &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;My TeamCity server is run on x86, so when I run the NAnt script and execute the NUnit tests from the nunit console, I have to make sure to run nunit-console-x86.exe for the tests to run properly. &lt;/p&gt;  &lt;p&gt;The project build configuration uses the NAnt build runner.&amp;nbsp; This file is located in the root directory of my project.&amp;nbsp; The NAnt executable is included in my tools directory of my project so the build server doesn’t have to have NAnt installed (or even on the client).&lt;/p&gt;  &lt;p&gt;So for the NUnit tests to report the test results back to TeamCity, we need to use an addin that comes with TeamCity.&amp;nbsp; There is some documentation &lt;a href="http://www.jetbrains.net/confluence/display/TCD4/TeamCity+Addin+for+NUnit"&gt;here&lt;/a&gt;, but it doesn’t show how to retrieve the addin for NAnt or go into much detail about the exact functionality.&lt;/p&gt;  &lt;p&gt;For Typemock to run on the TeamCity machine without having it installed, we have to use the auto-deploy feature (documented &lt;a href="http://www.typemock.com/Docs/UserGuide/newGuide/Documentation/InstallingAutoDeploy.html"&gt;here&lt;/a&gt;).&amp;nbsp; Now, what I’ve done was copied the common files and .dlls that I use in my project to a directory (tools/typemock) and then copied the appropriate bit version from either the x86 or x64 directory in the TypeMock/Isolator/5.2 directory.&amp;nbsp; These 2 files (MockWeaver and ProfileLinker) are specific to x86 or x64, so depending on your TeamCity server, you’ll want to get the correct one.&lt;/p&gt;  &lt;p&gt;Here is the target node for the tests in my NAnt script:&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;target&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;tests.run.MyProject&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;depends&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;compile.source&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;if&lt;/span&gt; &lt;span class="attr"&gt;test&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;${property::exists(&amp;#39;teamcity.dotnet.nunitaddin&amp;#39;)}&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;echo&lt;/span&gt; &lt;span class="attr"&gt;message&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;TeamCity NUnit dll&amp;#39;s found, copy to NUnit addin directory&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;mkdir&lt;/span&gt; &lt;span class="attr"&gt;dir&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;${nunit.addins.directory}&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;copy&lt;/span&gt; &lt;span class="attr"&gt;todir&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;${nunit.addins.directory}&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;flatten&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;fileset&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;include&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;${teamcity.dotnet.nunitaddin}-2.4.6.*&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;                    &lt;br /&gt;            &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;fileset&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;copy&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;            &lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;if&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;echo&lt;/span&gt; &lt;span class="attr"&gt;message&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Starting to run tests&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;        &lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;loadtasks&lt;/span&gt; &lt;span class="attr"&gt;assembly&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;${typemock.dir}\TypeMock.NAntBuild.dll&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;typemockregister&lt;/span&gt; &lt;span class="attr"&gt;company&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;My Company&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;license&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;My License&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;autodeploy&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;True&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;br /&gt;    &lt;span class="rem"&gt;&amp;lt;!-- Start Typemock Isolator --&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;typemockstart&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="rem"&gt;&amp;lt;!-- Execute tests using NUnit --&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;exec&lt;/span&gt; &lt;span class="attr"&gt;program&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;${nunit}&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;failonerror&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;false&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;verbose&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;arg&lt;/span&gt; &lt;span class="attr"&gt;value&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;${assemblies.output.dir}MyProject.Core.Tests.dll&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;arg&lt;/span&gt; &lt;span class="attr"&gt;value&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;/xml:${tests.output.dir}/MyProject.TestsResults.xml&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;            &lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;exec&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="rem"&gt;&amp;lt;!-- Stop Typemock Isolator --&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;typemockstop&lt;/span&gt; &lt;span class="attr"&gt;undeploy&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;target&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;style&gt;






.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;b&gt;Step 1&lt;/b&gt;: the &amp;lt;if&amp;gt; statement will determine if the variable, ${teamcity.dotnet.nunitaddin} exists.&amp;nbsp; This is so we can run our build script locally without having the script fail looking for a variable that isn’t passed when you’re not running TeamCity locally.&amp;nbsp; If this is a TeamCity build, it will retrieve the correct .dll (JetBrains.TeamCity.NUnitAddin-NUnit-2.4.6.dll in this case) and put it into the addin directory where NUnit is being executed from.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Step 2&lt;/b&gt;:&amp;nbsp; the &amp;lt;loadtasks&amp;gt;, &amp;lt;typemockregister&amp;gt; and &amp;lt;typemockstart&amp;gt; statements will load the necessary .dll for Typemock and NAnt to play nice together.&amp;nbsp; More about this can be read &lt;a href="http://www.typemock.com/Docs/UserGuide/NAntBuild.html"&gt;here&lt;/a&gt;. We then have to register typemock and specify the autodeploy property to true.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Step 3&lt;/b&gt;:&amp;nbsp; &amp;lt;exec&amp;gt; – this will run Nunit with the specified test .dll and send the results to a separate folder to view later.&amp;nbsp; You can run more than a single DLL in the tests by adding another line under the existing Tests.dll &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;arg&lt;/span&gt; &lt;span class="attr"&gt;value&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;${assemblies.output.dir}MyProject.Presentation.Tests.dll&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt; , but you cannot use the wildcard to specify tests using this method.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Step 4&lt;/b&gt;: &amp;lt;typemockstop&amp;gt; will unregister Typemock from the system.&lt;/p&gt;

&lt;p&gt;My script runs the tests from a specified directory called AutomatedBuildOutput (as described in &lt;a href="http://devlicio.us/blogs/derik_whittaker/default.aspx"&gt;Derik Whittaker’s&lt;/a&gt; &lt;a href="http://dimecasts.net/Casts/CastDetails/81"&gt;Dimecast&lt;/a&gt;), so that is where the variable, ${assemblies.output.dir}, points to.&lt;/p&gt;

&lt;p&gt;This should get you pointed in the right direction on getting Typemock tests integrated with TeamCity.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;--EDIT--&lt;/b&gt;: One more thing, you need to add these 2 &lt;b&gt;Environment Variables&lt;/b&gt; to the build configuration for Typemock to run using this method (Step 6: Properties and environment variables&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;COR_PROFILER = {B146457E-9AED-4624-B1E5-968D274416EC} &lt;/li&gt;

  &lt;li&gt;Cor_Enable_Profiling = 0x1 &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src="http://devlicio.us/blogs/steve_wright/Typemock_env_2F75D356.png" title="Typemock_env" style="border-width:0px;display:inline;" alt="Typemock_env" width="621" border="0" height="248" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=44742" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/StephenWright/~4/rbjSNMwvc1s" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/steve_wright/archive/tags/Typemock/default.aspx">Typemock</category><category domain="http://devlicio.us/blogs/steve_wright/archive/tags/TeamCity/default.aspx">TeamCity</category><feedburner:origLink>http://devlicio.us/blogs/steve_wright/archive/2009/03/01/typemock-nunit-results-to-teamcity.aspx</feedburner:origLink></item><item><title>Creating a Yellow Fade with ASP.NET AJAX Toolkit</title><link>http://feedproxy.google.com/~r/StephenWright/~3/qXXhhsfNSsQ/creating-a-yellow-fade-with-asp-net-ajax-toolkit.aspx</link><pubDate>Sun, 20 Jan 2008 17:28:37 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:39276</guid><dc:creator>Stephen Wright</dc:creator><slash:comments>5</slash:comments><wfw:commentRss>http://devlicio.us/blogs/steve_wright/rsscomments.aspx?PostID=39276</wfw:commentRss><comments>http://devlicio.us/blogs/steve_wright/archive/2008/01/20/creating-a-yellow-fade-with-asp-net-ajax-toolkit.aspx#comments</comments><description>&lt;p&gt;I&amp;#39;ve always thought that the &lt;a href="http://www.37signals.com/svn/archives/000558.php" target="_blank"&gt;Yellow Fade Technique&lt;/a&gt; has been a great way to present changes to a web page.&amp;nbsp; It&amp;#39;s used in all of 37Signal&amp;#39;s applications such as BaseCamp and CampFire.&amp;nbsp; It highlights the changes in a page using a yellow background, then fades out to the normal background.&amp;nbsp; This gives a visual cue to the user that something has changed on the page.&amp;nbsp; You can also use it to get the user&amp;#39;s attention (which is what I use it for).&lt;/p&gt; &lt;p&gt;I searched to find the JavaScript to use in my own application and couldn&amp;#39;t find anything that was easily integrated into the &amp;quot;controls&amp;quot; structure of ASP.NET.&amp;nbsp; Anything that I was going to use would need to hack into the body tag and the header tag to place functions initializing it.&amp;nbsp; Here&amp;#39;s a quick way to accomplish this using ASP.NET Ajax and the Control Toolkit.&lt;/p&gt; &lt;p&gt;This example assumes that you have .NET 3.5 and the AJAX Control Toolkit installed.&amp;nbsp; If you don&amp;#39;t have it, you can download the the .NET 3.5 Framework and the Control Toolkit from the official website: &lt;a title="http://asp.net/ajax/ajaxcontroltoolkit/" href="http://asp.net/ajax/"&gt;http://asp.net/ajax/&lt;/a&gt;&lt;/p&gt; &lt;p&gt;For this example, I am using the AnimationExtender.&amp;nbsp; Here&amp;#39;s the .aspx: &lt;/p&gt; &lt;div style="border-right:#cccccc 1px dashed;padding-right:4px;border-top:#cccccc 1px dashed;padding-left:4px;background:#eeeeee;padding-bottom:4px;overflow:auto;border-left:#cccccc 1px dashed;width:525px;padding-top:4px;border-bottom:#cccccc 1px dashed;height:200px;"&gt; &lt;div style="font-size:10pt;background:white;color:black;font-family:tahoma;"&gt;&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ajaxToolkit:AnimationExtender&lt;/span&gt;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;ID&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;AnimationExtender1&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;runat&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;server&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;TargetControlID&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;divResponse&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;Enabled&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;True&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;div&lt;/span&gt;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;id&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;divResponse&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;runat&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;server&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;style&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;width: 500px; padding: 10px;&amp;nbsp;&amp;nbsp;&amp;nbsp; margin-bottom: 10px;&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;visible&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;false&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;strong&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;asp:Literal&lt;/span&gt;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;ID&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;litResponseText&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;runat&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;Server&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; /&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;strong&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;div&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin:0px;"&gt;Display Name: &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;asp:Textbox&lt;/span&gt;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;id&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;txtDisplay&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;runat&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;server&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;asp:LinkButton&lt;/span&gt;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;id&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;btnSubmit&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;runat&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;server&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;Text&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;Update&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The div named &amp;quot;divResponse&amp;quot; is the container for our response on postback.&amp;nbsp; We can now add the code to handle adding the Animation properties to the AnimationExtender:&lt;br /&gt;&lt;/p&gt;
&lt;div style="border-right:#cccccc 1px dashed;padding-right:4px;border-top:#cccccc 1px dashed;padding-left:4px;background:#eeeeee;padding-bottom:4px;overflow:auto;border-left:#cccccc 1px dashed;width:525px;padding-top:4px;border-bottom:#cccccc 1px dashed;height:200px;"&gt;
&lt;div style="font-size:10pt;background:white;color:black;font-family:tahoma;"&gt;&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;Protected&lt;/span&gt; &lt;span style="color:blue;"&gt;Sub&lt;/span&gt; btnUpdate_Click(&lt;span style="color:blue;"&gt;ByVal&lt;/span&gt; sender &lt;span style="color:blue;"&gt;As&lt;/span&gt; &lt;span style="color:blue;"&gt;Object&lt;/span&gt;, &lt;span style="color:blue;"&gt;ByVal&lt;/span&gt; e &lt;span style="color:blue;"&gt;As&lt;/span&gt; EventArgs) &lt;span style="color:blue;"&gt;Handles&lt;/span&gt; btnUpdate.Click&lt;/pre&gt;&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; divResponse.Visible = &lt;span style="color:blue;"&gt;True&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;If&lt;/span&gt; &lt;span style="color:blue;"&gt;String&lt;/span&gt;.IsNullOrEmpty(txtDisplayName.Text) &lt;span style="color:blue;"&gt;Then&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; litResponseText.Text = &lt;span style="color:#a31515;"&gt;&amp;quot;Please enter a Display Name&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AnimationExtender1.Animations = &lt;span style="color:#a31515;"&gt;&amp;quot;&amp;lt;OnLoad&amp;gt;&amp;lt;Sequence&amp;gt;&amp;lt;Parallel Duration=&amp;quot;&amp;quot;5&amp;quot;&amp;quot;&amp;gt;&amp;lt;Color Duration=&amp;quot;&amp;quot;5&amp;quot;&amp;quot; StartValue=&amp;quot;&amp;quot;#FF4500&amp;quot;&amp;quot; EndValue=&amp;quot;&amp;quot;#FFFFFF&amp;quot;&amp;quot; Property=&amp;quot;&amp;quot;style&amp;quot;&amp;quot; PropertyKey=&amp;quot;&amp;quot;backgroundColor&amp;quot;&amp;quot; /&amp;gt;&amp;lt;Color Duration=&amp;quot;&amp;quot;4&amp;quot;&amp;quot; StartValue=&amp;quot;&amp;quot;#000000&amp;quot;&amp;quot; EndValue=&amp;quot;&amp;quot;#FF0000&amp;quot;&amp;quot; Property=&amp;quot;&amp;quot;style&amp;quot;&amp;quot; PropertyKey=&amp;quot;&amp;quot;color&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/Parallel&amp;gt;&amp;lt;/Sequence&amp;gt;&amp;lt;/OnLoad&amp;gt;&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;Else&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:green;"&gt;&amp;#39;Save your Display Name property&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; litResponseText.Text = &lt;span style="color:#a31515;"&gt;&amp;quot;Updated Successfully&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AnimationExtender1.Animations = &lt;span style="color:#a31515;"&gt;&amp;quot;&amp;lt;OnLoad&amp;gt;&amp;lt;Sequence&amp;gt;&amp;lt;Parallel Duration=&amp;quot;&amp;quot;5&amp;quot;&amp;quot;&amp;gt;&amp;lt;Color Duration=&amp;quot;&amp;quot;5&amp;quot;&amp;quot; StartValue=&amp;quot;&amp;quot;#FFD700&amp;quot;&amp;quot; EndValue=&amp;quot;&amp;quot;#FFFFFF&amp;quot;&amp;quot; Property=&amp;quot;&amp;quot;style&amp;quot;&amp;quot; PropertyKey=&amp;quot;&amp;quot;backgroundColor&amp;quot;&amp;quot; /&amp;gt;&amp;lt;Color Duration=&amp;quot;&amp;quot;4&amp;quot;&amp;quot; StartValue=&amp;quot;&amp;quot;#000000&amp;quot;&amp;quot; EndValue=&amp;quot;&amp;quot;#008000&amp;quot;&amp;quot; Property=&amp;quot;&amp;quot;style&amp;quot;&amp;quot; PropertyKey=&amp;quot;&amp;quot;color&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/Parallel&amp;gt;&amp;lt;/Sequence&amp;gt;&amp;lt;/OnLoad&amp;gt;&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;End&lt;/span&gt; &lt;span style="color:blue;"&gt;If&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;End&lt;/span&gt; &lt;span style="color:blue;"&gt;Sub&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;br /&gt;The first thing we want to do is to make the divResponse visible.&amp;nbsp; We then can start our processing.&amp;nbsp; We want to add properties to the AnimationExtender based on if the properties were set properly.&amp;nbsp; If it failed, we add the error text to the litResponseText Literal, then add Animation Property Tag, which would look like this in the end:&lt;/p&gt;
&lt;div style="border-right:#cccccc 1px dashed;padding-right:4px;border-top:#cccccc 1px dashed;padding-left:4px;background:#eeeeee;padding-bottom:4px;overflow:auto;border-left:#cccccc 1px dashed;width:525px;padding-top:4px;border-bottom:#cccccc 1px dashed;height:200px;"&gt;
&lt;div style="font-size:10pt;background:white;color:black;font-family:tahoma;"&gt;&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ajaxToolkit:AnimationExtender&lt;/span&gt;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;ID&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;AnimationExtender1&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;runat&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;server&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:red;"&gt;TargetControlID&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;divResponse&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;Enabled&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;True&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Animations&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;OnLoad&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Sequence&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Parallel&lt;/span&gt;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;Duration&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;5&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Color&lt;/span&gt;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;Duration&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;5&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;StartValue&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;#FF4500&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;EndValue&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;#FFFFFF&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:red;"&gt;Property&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;style&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;PropertyKey&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;backgroundColor=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; /&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Color&lt;/span&gt;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;Duration&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;4&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;StartValue&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;#000000&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;EndValue&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;#FF0000&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:red;"&gt;Property&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;style&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;PropertyKey&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;color&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; /&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Parallel&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Sequence&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;OnLoad&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Animations&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ajaxToolkit:AnimationExtender&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The Parallel tag will execute both of the properties at the same time.&amp;nbsp; What we&amp;#39;re doing is starting the div with a background of Red/Orange and fading this color to white, while the text color is fading from Black to Red.&lt;/p&gt;
&lt;p&gt;If the Display Name was valid, we want to note a successful call.&amp;nbsp; This will fade the background from yellow to white and the forecolor from black to green.&lt;/p&gt;
&lt;p&gt;HTH&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=39276" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/StephenWright/~4/qXXhhsfNSsQ" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/steve_wright/archive/tags/ASP.NET/default.aspx">ASP.NET</category><feedburner:origLink>http://devlicio.us/blogs/steve_wright/archive/2008/01/20/creating-a-yellow-fade-with-asp-net-ajax-toolkit.aspx</feedburner:origLink></item><item><title>The Programmer's Dilemma</title><link>http://feedproxy.google.com/~r/StephenWright/~3/mtE5KKMHE2g/the-programmer-s-dilemma.aspx</link><pubDate>Sun, 13 Jan 2008 08:13:05 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:39216</guid><dc:creator>Stephen Wright</dc:creator><slash:comments>3</slash:comments><wfw:commentRss>http://devlicio.us/blogs/steve_wright/rsscomments.aspx?PostID=39216</wfw:commentRss><comments>http://devlicio.us/blogs/steve_wright/archive/2008/01/13/the-programmer-s-dilemma.aspx#comments</comments><description>&lt;p&gt;I&amp;#39;ve been trying to come up with excuses why I can&amp;#39;t come up with &amp;quot;examples&amp;quot; or &amp;quot;code improvements&amp;quot; for the ASP.NET community or more importantly: &amp;quot;What do I bring to the table?&amp;quot;&lt;/p&gt; &lt;p&gt;I&amp;#39;ve been watching a lot of the conversations on the ALT.NET/CLI group and it actually makes me feel worse as a programmer.&amp;nbsp; We&amp;#39;re a &amp;quot;young&amp;quot; group and people are trying to tell each other to do our jobs.&amp;nbsp; What really is the best way to approach coding?&amp;nbsp; What makes you a good programmer? (I posed this question earlier on Twitter).&lt;/p&gt; &lt;p&gt;I&amp;#39;ve tried to think of real world examples of code that I&amp;#39;ve used that has been a &amp;quot;fore-runner&amp;quot; in the community, but I&amp;#39;ve run into a roadblock every time.&amp;nbsp; I write new code every day, but it seems so old and archaic to me.&amp;nbsp; Is that silly?&lt;/p&gt; &lt;p&gt;Most of the code that I write involves the controls that I use in my application, and nothing to do with the code to retrieve data or work in the DAL.&lt;/p&gt; &lt;p&gt;What does this have to do with current events in the .NET community?&amp;nbsp; Pretty much EVERYTHING!&lt;/p&gt; &lt;p&gt;If you haven&amp;#39;t been following, there have been multiple conversations on Yahoo&amp;#39;s message boards about HOW you program.&amp;nbsp; People have left message boards because of their stance. It amazes me that people&amp;#39;s opinions about computer science can steer a career in a different direction.&amp;nbsp; Being on the outside, looking in, I see that it&amp;#39;s mostly an attack on how someone&amp;#39;s approach on a problem is being criticized, not the end result.&lt;/p&gt; &lt;p&gt;Take &lt;a href="http://weblogs.asp.net/fbouma/default.aspx" target="_blank"&gt;Frans Bouma&lt;/a&gt; for example. he has &amp;quot;exposed&amp;quot;(and not in a bad way) his view on programming and how it should be approached in different forums and been shot down in the most heinous way.&amp;nbsp; He was only stating the real world examples on what he has worked on and the &amp;quot;ALT.NET&amp;quot; community took a crap on him.&amp;nbsp; &lt;/p&gt; &lt;p&gt;I don&amp;#39;t think he was treated fairly.&amp;nbsp; He gave his opinion, people shot it down, and now, because of his opinion, he&amp;#39;s anti-&amp;quot;ALT.NET&amp;quot;.&amp;nbsp; That was hardly his point.&amp;nbsp; He simply wanted to give a point of vie that didn&amp;#39;t apply to the &amp;quot;ideal&amp;quot; situation.&amp;nbsp; I agree with his stance since not every every programming situation calls for TDD and interfaces and mocks.&amp;nbsp; I have been in plenty of different situations where I don&amp;#39;t have time to build the interface, DAL, BLL and tests in time for it to ship to the customer.&amp;nbsp; &lt;/p&gt; &lt;p&gt;In these situations, you have to feel comfortable that what you have built is what the customer wanted in the first place and not about how you feel how you programmed.&lt;/p&gt; &lt;p&gt;Which brings me back to my original question on Twitter:&amp;nbsp; &amp;quot;What makes you a good programmer?&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=39216" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/StephenWright/~4/mtE5KKMHE2g" height="1" width="1"/&gt;</description><feedburner:origLink>http://devlicio.us/blogs/steve_wright/archive/2008/01/13/the-programmer-s-dilemma.aspx</feedburner:origLink></item><item><title>Time Zone Issues</title><link>http://feedproxy.google.com/~r/StephenWright/~3/ewYB7BL0Wws/time-zone-issues.aspx</link><pubDate>Thu, 15 Nov 2007 08:37:39 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:38852</guid><dc:creator>Stephen Wright</dc:creator><slash:comments>3</slash:comments><wfw:commentRss>http://devlicio.us/blogs/steve_wright/rsscomments.aspx?PostID=38852</wfw:commentRss><comments>http://devlicio.us/blogs/steve_wright/archive/2007/11/15/time-zone-issues.aspx#comments</comments><description>&lt;p&gt;Sounds like a book title, doesn&amp;#39;t it?&amp;nbsp; It&amp;#39;s a horror story.&amp;nbsp; &lt;/p&gt; &lt;p&gt;Currently, I&amp;#39;m using a class library that uses the Windows Registry to return information about a specific date.&amp;nbsp; I found it on Code Project and it REQUIRED a full trust environment. Luckily, I didn&amp;#39;t need to run in a shared hosting environment and I didn&amp;#39;t want to build my own DST provider for every time zone.&amp;nbsp; I&amp;#39;ve been using it for about 2 years now and I think it&amp;#39;s time to move over to the new TimeZone2 functionality that will be included in the .NET Framework 3.5 release.&lt;/p&gt; &lt;p&gt;Kathy Kam, member of the BCL Team, says from a &lt;a href="http://blogs.msdn.com/bclteam/archive/2006/10/03/System.TimeZone2-Starter-Guide-_5B00_Kathy-Kam_5D00_.aspx" target="_blank"&gt;post&lt;/a&gt; a while ago:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;In the “Orcas” September CTP, you’ll see that the BCL team has added a new class named “System.TimeZone2” that will allow you to:  &lt;ul&gt; &lt;li&gt;Convert a DateTime from one time zone (not necessarily your machine’s time zone) to another  &lt;li&gt;Get an object that describes your local time zone  &lt;li&gt;Get an array of objects that describes all the available time zones on your machine  &lt;li&gt;Serialize a time zone into a string  &lt;li&gt;Create your own time zone object to represent any custom time zones&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;The best part about this is that… if you are on an Vista machine… all of those functionality will have &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/dynamic_time_zone_information.asp" target="_blank"&gt;Vista’s Dynamic Time Zone&lt;/a&gt; support, because our calculations are done with the time zone data available on your OS.&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;This is wonderful news for me.&amp;nbsp; I no longer have to depend on the old class library to store my time zone information.&lt;/p&gt; &lt;p&gt;For more information on the TimeZoneInfo Class, you can read about it on the &lt;a href="http://msdn2.microsoft.com/en-us/library/system.timezoneinfo(VS.90).aspx" target="_blank"&gt;MSDN site&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=38852" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/StephenWright/~4/ewYB7BL0Wws" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/steve_wright/archive/tags/ASP.NET/default.aspx">ASP.NET</category><feedburner:origLink>http://devlicio.us/blogs/steve_wright/archive/2007/11/15/time-zone-issues.aspx</feedburner:origLink></item><item><title>My Unit Testing Challenge</title><link>http://feedproxy.google.com/~r/StephenWright/~3/O-nkx4mfQXc/unit-testing-amp-gui-testing-challenge.aspx</link><pubDate>Tue, 23 Oct 2007 21:02:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:38707</guid><dc:creator>Stephen Wright</dc:creator><slash:comments>3</slash:comments><wfw:commentRss>http://devlicio.us/blogs/steve_wright/rsscomments.aspx?PostID=38707</wfw:commentRss><comments>http://devlicio.us/blogs/steve_wright/archive/2007/10/23/unit-testing-amp-gui-testing-challenge.aspx#comments</comments><description>&lt;p&gt;&lt;img src="http://devlicio.us/blogs/steve_wright/WindowsLiveWriter/UnitTestingGUITestingChallenge_1277B/Objects_thumb.gif" alt="Objects" align="right" /&gt; I&amp;#39;ve always thought of myself as a decent programmer.&amp;nbsp; I&amp;#39;m able to find solutions for people and I get rave reviews on how great something works.&amp;nbsp; However, there&amp;#39;s always been a part of me that knows that I can program it better using agile methods and sound fundamentals.&lt;/p&gt;  &lt;p&gt;I haven&amp;#39;t taken the time to implement unit testing in my application because of time constraints.&amp;nbsp; It&amp;#39;s been one of those things that has always left a sour taste in my programming mouth.&amp;nbsp; For an application that spans 300 pages, 200 controls and 100 Controller Modules, you&amp;#39;d think that I&amp;#39;d have a better handle on the code and a testing plan in place.&lt;/p&gt; &lt;p&gt;&lt;img src="http://devlicio.us/blogs/steve_wright/WindowsLiveWriter/UnitTestingGUITestingChallenge_1277B/nunit_1.png" style="border:0px none;margin:0px 10px 0px 0px;" alt="nunit" align="left" border="0" height="63" width="118" /&gt;Instead of automated testing, we have our QA team go through printed scripts (some over 200 pages).&amp;nbsp; Some of the site is still undocumented and we do not have a formal testing plan, so we have to remember to test it out before it&amp;#39;s sent to the customer.&amp;nbsp; As a rule of thumb, we&amp;#39;ve always set aside double the time we estimate for programming.&amp;nbsp; Not the most efficient way to estimate, but it&amp;#39;s worked for us in the past.&amp;nbsp; We&amp;#39;ve gotten to the point in a program that it is no longer practical.&lt;/p&gt;&lt;p&gt;Why am I able to get away with this?&amp;nbsp; I am the architect.&amp;nbsp; I am
involved from the kickoff to the deployment.&amp;nbsp; I am creative control.&amp;nbsp; I
can tell you in 30 seconds whether or not a certain feature exists.&amp;nbsp; If
something doesn&amp;#39;t work properly, I&amp;#39;m the one to fix it. &lt;br /&gt;&lt;/p&gt; &lt;p&gt;The solution to this is putting in unit tests for all of the code in the site.&lt;/p&gt; &lt;p&gt;Jeremy Miller from CodeBetter is a proponent of Unit Testing and Agile methods.&amp;nbsp; He says in his &lt;a href="http://codebetter.com/blogs/jeremy.miller/archive/2006/10/30/My-Programming-Manifesto.aspx" target="_blank"&gt;Programming Manifesto&lt;/a&gt;:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&amp;quot;An axiom of software development is that &lt;b&gt;problems are cheaper to fix the sooner that the problems are detected&lt;/b&gt;.&amp;nbsp; If you take that axiom at face value, it&amp;#39;s easy to see why I put far more weight into comprehensive test-first&amp;nbsp;unit testing because it gives you far more rapid feedback to find problems fast.&amp;nbsp; Small, isolated unit tests work on very granular pieces of the code, so the number of variables in any single unit test should be small (if it&amp;#39;s not, look for a different way to write the code).&amp;nbsp; You shouldn&amp;#39;t even try to run the code as a whole until all the constituent pieces have been validated through unit tests.&amp;quot;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;This is very easy to build if you are starting a new project.&amp;nbsp; What do you do if you have a large, enterprise-sized project that has no unit testing?&amp;nbsp; You start out with your business layer and build from there. Start with a small method, then you can build up from each class.&amp;nbsp; &lt;/p&gt;&lt;p&gt;I worry about trying to get the Lexus when I&amp;#39;m only looking to build a Kia.&amp;nbsp; I want everything to be perfect when I&amp;#39;ve gotten something to the point of &amp;quot;release ready&amp;quot;.&lt;br /&gt;&lt;/p&gt; &lt;p&gt;When Jeff Atwood (Coding Horror) started posted about formal unit tests, he was struggling&amp;nbsp;to find the &lt;a href="http://www.codinghorror.com/blog/archives/000265.html" target="_blank"&gt;&amp;quot;perfect test&amp;quot;&lt;/a&gt;:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&amp;quot;You&amp;#39;ll get no argument from me on the fundamental value of unit testing. Even the most trivially basic unit test, as shown in the code sample above, is a huge step up from the testing most developers perform-- which is to say, &lt;b&gt;most developers don&amp;#39;t test at all!&lt;/b&gt; They key in a few values at random and click a few buttons. If they don&amp;#39;t get any unhandled exceptions, that code is ready for QA!&amp;quot;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;So I start by building small tests and work from there.&amp;nbsp; It may take a long time to fully implement unit tests, but I believe this will be to our advantage in the end.&lt;/p&gt; &lt;p&gt;I offered this solution of adding unit tests and GUI automation to my boss.&amp;nbsp; He seems to think that this will add significant time to programming and it won&amp;#39;t be practical.&amp;nbsp; The real problem that he doesn&amp;#39;t trust that the interface will get a thorough testing.&amp;nbsp; I told him that there are ways to get this working (possibly using InCisif or WatiN) that would be just like one of the QA team.&amp;nbsp; He really just can&amp;#39;t see how it will work for us.&amp;nbsp; &lt;/p&gt; &lt;p&gt;I don&amp;#39;t know how I can explain to him that it will end up in his best interest (and mine) to add the unit tests for the business layer and for the GUI.&amp;nbsp; If not, I guess I&amp;#39;ll just have to revert back to programming using &lt;a href="http://www.haacked.com/archive/2007/09/24/bug-driven-development.aspx" target="_blank"&gt;BDD&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=38707" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/StephenWright/~4/O-nkx4mfQXc" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/steve_wright/archive/tags/TDD/default.aspx">TDD</category><feedburner:origLink>http://devlicio.us/blogs/steve_wright/archive/2007/10/23/unit-testing-amp-gui-testing-challenge.aspx</feedburner:origLink></item><item><title>Visual Studio 2005, Why do you taunt me?</title><link>http://feedproxy.google.com/~r/StephenWright/~3/MQ6ekCzRvlk/visual-studio-2005-why-do-you-taunt-me.aspx</link><pubDate>Thu, 19 Jul 2007 20:01:46 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:34479</guid><dc:creator>Stephen Wright</dc:creator><slash:comments>3</slash:comments><wfw:commentRss>http://devlicio.us/blogs/steve_wright/rsscomments.aspx?PostID=34479</wfw:commentRss><comments>http://devlicio.us/blogs/steve_wright/archive/2007/07/19/visual-studio-2005-why-do-you-taunt-me.aspx#comments</comments><description>&lt;p&gt;&lt;strong&gt;729,942K&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Can you fathom that a program uses this much memory?&amp;nbsp; I have a Dell Inspiron 9100 with 2G of memory.&lt;/p&gt; &lt;p&gt;I can't even believe that Visual Studio uses this much memory just to run my application.&amp;nbsp; I've got a lot of code, but you'd think that it would be able to manage it better.&lt;/p&gt; &lt;p&gt;&lt;img height="452" src="http://webimages.stephen-wright.net/IHateVS2005.jpg" width="460"&gt;&lt;/p&gt; &lt;p&gt;Why?&amp;nbsp; &lt;/p&gt; &lt;p&gt;I don't even know what I could do to help.&amp;nbsp; I'm starting to think that building the &lt;a href="http://geekswithblogs.net/.NETonMyMind/archive/2007/04/29/112086.aspx" target="_blank"&gt;virtualization environment&lt;/a&gt; will be the way to go.&lt;/p&gt; &lt;p&gt;I've already got Parallels on my machine, why not use it to the fullest extent?&lt;/p&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=34479" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/StephenWright/~4/MQ6ekCzRvlk" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/steve_wright/archive/tags/Virtualization/default.aspx">Virtualization</category><feedburner:origLink>http://devlicio.us/blogs/steve_wright/archive/2007/07/19/visual-studio-2005-why-do-you-taunt-me.aspx</feedburner:origLink></item><item><title>IE6 VPC Image - Part Deux</title><link>http://feedproxy.google.com/~r/StephenWright/~3/6-J7oXmxmR8/ie6-vpc-image-part-deux.aspx</link><pubDate>Tue, 20 Mar 2007 20:46:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:17764</guid><dc:creator>Stephen Wright</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://devlicio.us/blogs/steve_wright/rsscomments.aspx?PostID=17764</wfw:commentRss><comments>http://devlicio.us/blogs/steve_wright/archive/2007/03/20/ie6-vpc-image-part-deux.aspx#comments</comments><description>&lt;p&gt;Because the license to use the original IE6 VirtualPC image was good until April 1, 2007, Microsoft has released another version.&amp;nbsp; You can download it directly from Microsoft &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=21EABB90-958F-4B64-B5F1-73D0A413C8EF&amp;amp;displaylang=en" target="_blank"&gt;here&lt;/a&gt;. &lt;br&gt;&lt;/p&gt;&lt;p&gt;REF: &lt;a href="http://blogs.msdn.com/ie/archive/2007/03/20/ie6-vpc-refresh-now-available.aspx" target="_blank"&gt;IE Team Blog&amp;nbsp;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=17764" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/StephenWright/~4/6-J7oXmxmR8" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/steve_wright/archive/tags/ASP.NET/default.aspx">ASP.NET</category><feedburner:origLink>http://devlicio.us/blogs/steve_wright/archive/2007/03/20/ie6-vpc-image-part-deux.aspx</feedburner:origLink></item><item><title>nToolbox - Utility Library Extraordinaire</title><link>http://feedproxy.google.com/~r/StephenWright/~3/Cc50sLDJGdo/please-welcome-ntoolbox.aspx</link><pubDate>Tue, 30 Jan 2007 19:58:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:7593</guid><dc:creator>Stephen Wright</dc:creator><slash:comments>4</slash:comments><wfw:commentRss>http://devlicio.us/blogs/steve_wright/rsscomments.aspx?PostID=7593</wfw:commentRss><comments>http://devlicio.us/blogs/steve_wright/archive/2007/01/30/please-welcome-ntoolbox.aspx#comments</comments><description>&lt;p&gt;After some thought, I've decided to go forth with &lt;a href="http://www.ntoolbox.com" target="_blank"&gt;nToolbox&lt;/a&gt;.&amp;nbsp; Those that have expressed interest, I will be contacting you soon about it.&amp;nbsp; For those that are interested, you can visit the site and enter your information into the join form!&lt;br&gt;&lt;/p&gt;&lt;p&gt;I'm excited to get this project off the ground.&lt;br&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=7593" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/StephenWright/~4/Cc50sLDJGdo" height="1" width="1"/&gt;</description><feedburner:origLink>http://devlicio.us/blogs/steve_wright/archive/2007/01/30/please-welcome-ntoolbox.aspx</feedburner:origLink></item><item><title>Common Class Library</title><link>http://feedproxy.google.com/~r/StephenWright/~3/75bZ1dcru8Q/common-class-library.aspx</link><pubDate>Thu, 25 Jan 2007 19:59:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:6237</guid><dc:creator>Stephen Wright</dc:creator><slash:comments>13</slash:comments><wfw:commentRss>http://devlicio.us/blogs/steve_wright/rsscomments.aspx?PostID=6237</wfw:commentRss><comments>http://devlicio.us/blogs/steve_wright/archive/2007/01/25/common-class-library.aspx#comments</comments><description>&lt;p&gt;I've come to the conclusion that the information that I have to offer to the .NET community is old news.&amp;nbsp; Someone has already done everything that I've been doing with .NET so how can I best use my knowledge and insight to help in any way possible?&lt;/p&gt;&lt;p&gt;With all the different code libraries (PageHelpers, Nini, etc...) and applications (like DotNetNuke), there are still some &lt;a href="http://devlicio.us/blogs/steve_wright/archive/2006/10/07/My-favorite-little-function.aspx"&gt;functions that you always use&lt;/a&gt; in every project.&amp;nbsp; I have searched the web for this and haven't found anything yet.&amp;nbsp; Why not start an open source class library that is a repository for common functions?&amp;nbsp;&amp;nbsp; I started building my own common library for a weight tracking site I created, but I was using code from all over the web.&amp;nbsp; Why not actually start something that the community could be a part of and get credit for helping?&lt;/p&gt;&lt;p&gt;First things first, what will this library do?&amp;nbsp; I believe that it would be a library that does what the .NET framework doesn't have built in that has use in many different applications.&amp;nbsp; There would be a good structure for the namespace naming (Math, Security, Strings, etc...).&amp;nbsp;&lt;/p&gt;&lt;p&gt;Next would be where to host?&amp;nbsp; GoogleCode?&amp;nbsp; SourceForge?&amp;nbsp; GotDotNet? CodePlex?&lt;/p&gt;&lt;p&gt;A lot of things need to be answered before even starting, but it seems to me that a lot of people would want to use something like this in their applications, but without the mess of adding it every time to your code.&amp;nbsp;&lt;/p&gt;&lt;p&gt;If anyone is interested in helping out or if you have some good ideas, post them in the comments or contact me via email (wright.NOSPAMnet at my gmail REMOVE dot com)&lt;br&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=6237" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/StephenWright/~4/75bZ1dcru8Q" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/steve_wright/archive/tags/.NET/default.aspx">.NET</category><feedburner:origLink>http://devlicio.us/blogs/steve_wright/archive/2007/01/25/common-class-library.aspx</feedburner:origLink></item><item><title>Your ASP.NET Web Application Subversion Repository Structures</title><link>http://feedproxy.google.com/~r/StephenWright/~3/LxNYJIIRfxE/your-asp-net-web-application-subversion-repository-structures.aspx</link><pubDate>Fri, 15 Dec 2006 06:27:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:1548</guid><dc:creator>Stephen Wright</dc:creator><slash:comments>8</slash:comments><wfw:commentRss>http://devlicio.us/blogs/steve_wright/rsscomments.aspx?PostID=1548</wfw:commentRss><comments>http://devlicio.us/blogs/steve_wright/archive/2006/12/15/your-asp-net-web-application-subversion-repository-structures.aspx#comments</comments><description>&lt;p&gt;&lt;font face="verdana,geneva" size="2"&gt;I've been looking all over for some good, real-world example subversion structures for ASP.NET websites and have only come across a few.&amp;nbsp; I haven't really used any source control other than storing my code in a repository so it's not just on one computer.&lt;br&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font face="verdana,geneva" size="2"&gt;I've found a blog that has a lot of good examples (http://ariejan.net/2006/11/24/svn-how-to-structure-your-repository/) but there's nothing for specific examples for an ASP.NET.&amp;nbsp; There's some good ideas I found here (http://discuss.joelonsoftware.com/default.asp?dotnet.12.406052.3) but nothing about the best way to do it.&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="2"&gt;&lt;font face="verdana,geneva"&gt;I like the idea of the standard branches/tags/trunk, but does that always work on large scale web applications?&amp;nbsp; I started populating the trunk with the following folders:&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Database - contains a Red-Gate SQL Compare Snapshot of the database&lt;/li&gt;&lt;li&gt;LLBLGen - contains the LLBLGenPro v. 2 project&lt;/li&gt;&lt;li&gt;Libs - all .dll files that do not have source code associated with them, such as telerik controls, infragistics controls, browserhawk files, etc...&lt;/li&gt;&lt;li&gt;Source - root for any class libraries, projects get their own folder on a per project basis&lt;br&gt;&lt;/li&gt;&lt;li&gt;Webroot - the root of the web application project&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;I want to put all releases in the tags directory, then any working changes into the branch directory based on the build number (which contains the date).&lt;/p&gt;&lt;p&gt;I think this is a good way to keep track of everything, but I'm very open to other suggestions.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=1548" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/StephenWright/~4/LxNYJIIRfxE" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/steve_wright/archive/tags/Subversion/default.aspx">Subversion</category><feedburner:origLink>http://devlicio.us/blogs/steve_wright/archive/2006/12/15/your-asp-net-web-application-subversion-repository-structures.aspx</feedburner:origLink></item><item><title>My Favorite Little Function - FixUrl</title><link>http://feedproxy.google.com/~r/StephenWright/~3/7KkoQ-MDzSY/My-favorite-little-function.aspx</link><pubDate>Sat, 07 Oct 2006 05:45:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:260</guid><dc:creator>Stephen Wright</dc:creator><slash:comments>4</slash:comments><wfw:commentRss>http://devlicio.us/blogs/steve_wright/rsscomments.aspx?PostID=260</wfw:commentRss><comments>http://devlicio.us/blogs/steve_wright/archive/2006/10/07/My-favorite-little-function.aspx#comments</comments><description>One problem that I frequently run into is trying to get my javascript URLs to point to the correct directory by using the &amp;quot;~&amp;quot; root for an ASP.NET application.  Here&amp;#39;s a handy function that helps with trying to get to the root of a webapp:
&lt;br /&gt;&lt;br /&gt;
&lt;div style="overflow:auto;"&gt;

&lt;div style="background:white none repeat scroll 0% 50%;font-size:9pt;color:black;-moz-background-clip:-moz-initial;-moz-background-origin:-moz-initial;-moz-background-inline-policy:-moz-initial;"&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;Public&lt;/span&gt; &lt;span style="color:blue;"&gt;Function&lt;/span&gt; FixUrl(&lt;span style="color:blue;"&gt;ByVal&lt;/span&gt; Url &lt;span style="color:blue;"&gt;As&lt;/span&gt; &lt;span style="color:blue;"&gt;String&lt;/span&gt;) &lt;span style="color:blue;"&gt;As&lt;/span&gt; &lt;span style="color:blue;"&gt;String&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;Dim&lt;/span&gt; strReturn &lt;span style="color:blue;"&gt;As&lt;/span&gt; &lt;span style="color:blue;"&gt;String&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;If&lt;/span&gt; Url.StartsWith(&lt;span style="color:#a31515;"&gt;&amp;quot;~&amp;quot;&lt;/span&gt;) &lt;span style="color:blue;"&gt;And&lt;/span&gt; HttpContext.Current.Request.ApplicationPath &amp;lt;&amp;gt; &lt;span style="color:#a31515;"&gt;&amp;quot;/&amp;quot;&lt;/span&gt; &lt;span style="color:blue;"&gt;Then&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; strReturn = HttpContext.Current.Request.ApplicationPath &amp;amp; Url.Substring(1).Replace(&lt;span style="color:#a31515;"&gt;&amp;quot;//&amp;quot;&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;&amp;quot;/&amp;quot;&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;ElseIf&lt;/span&gt; Url.StartsWith(&lt;span style="color:#a31515;"&gt;&amp;quot;~&amp;quot;&lt;/span&gt;) &lt;span style="color:blue;"&gt;Then&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; strReturn = Right(Url, Len(Url) - 1)&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;Else&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; strReturn = Url&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;End&lt;/span&gt; &lt;span style="color:blue;"&gt;If&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;Return&lt;/span&gt; strReturn&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;End&lt;/span&gt; &lt;span style="color:blue;"&gt;Function&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;/div&gt;&lt;p&gt;
So what this function will do is take any URL that is passed (such as &amp;quot;~/admin/user.aspx&amp;quot;) will return the proper directory.

&lt;/p&gt;&lt;p&gt;If you are running your application at this URL: http://mytestapp.domain.com/, it will return &amp;quot;/admin/user.aspx&amp;quot;.  If you are running it locally for testing, such as http://localhost/mytestapp/, it will return &amp;quot;/mytestapp/admin/user.aspx&amp;quot;.

&lt;/p&gt;&lt;p&gt;This helps out when you are adding URLs to javascript calls through code (such as window.open(&amp;#39;/admin/user.aspx&amp;#39;, null, &amp;#39;etc...) and need to have a generic way to find the root of your application because the tilde will not work in this context.

&lt;/p&gt;&lt;p&gt;Enjoy! &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=260" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/StephenWright/~4/7KkoQ-MDzSY" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/steve_wright/archive/tags/ASP.NET/default.aspx">ASP.NET</category><feedburner:origLink>http://devlicio.us/blogs/steve_wright/archive/2006/10/07/My-favorite-little-function.aspx</feedburner:origLink></item><item><title>Scheduling the Import of data with ASP.NET</title><link>http://feedproxy.google.com/~r/StephenWright/~3/VTA51Iya40A/Importing-your-Business-Data-to-ASP.NET.aspx</link><pubDate>Tue, 03 Oct 2006 07:18:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:175</guid><dc:creator>Stephen Wright</dc:creator><slash:comments>1</slash:comments><wfw:commentRss>http://devlicio.us/blogs/steve_wright/rsscomments.aspx?PostID=175</wfw:commentRss><comments>http://devlicio.us/blogs/steve_wright/archive/2006/10/03/Importing-your-Business-Data-to-ASP.NET.aspx#comments</comments><description>&lt;p&gt;Most enterprise ASP.NET web applications have one thing in common: Data Imports.&amp;nbsp; Whether it is users, locations or transactions, 95%* of the applications that I&amp;#39;ve built for large corporations require some external data.&amp;nbsp; Handling this in ASP.NET has always been troublesome for me, so I thought I&amp;#39;d share my method with you.&amp;nbsp; &lt;/p&gt;&lt;p&gt;In the past, I&amp;#39;ve used Andy Brummer&amp;#39;s scheduled timer to execute my scheduled tasks (&lt;a href="http://www.codeproject.com/dotnet/ABTransClockArticle.asp" target="_blank"&gt;http://www.codeproject.com/dotnet/ABTransClockArticle.asp&lt;/a&gt;) in conjunction with Paul Wilson&amp;#39;s keep alive (&lt;a href="http://authors.aspalliance.com/paulwilson/Articles/?id=12" target="_blank"&gt;http://authors.aspalliance.com/paulwilson/Articles/?id=12&lt;/a&gt;).&amp;nbsp; This has been the best way that I&amp;#39;ve been able to make sure that the code will execute on the proper schedules. &lt;/p&gt;&lt;p&gt;Basically, a &amp;quot;timer&amp;quot; thread is executed when the application starts and is checked every millisecond.&amp;nbsp; If the current &amp;quot;tick&amp;quot; is the same as the set scheduled total ticks, then it will execute the import. &lt;br /&gt;&lt;/p&gt;I&amp;#39;ve been happy with this method and haven&amp;#39;t run into any problems with it.&lt;br /&gt;&lt;p&gt;&lt;em&gt;* estimated guess, I haven&amp;#39;t done any in depth studies on it, but I&amp;#39;ve worked on enough applications to know that it&amp;#39;s pretty much everyone.&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=175" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/StephenWright/~4/VTA51Iya40A" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/steve_wright/archive/tags/BLL/default.aspx">BLL</category><feedburner:origLink>http://devlicio.us/blogs/steve_wright/archive/2006/10/03/Importing-your-Business-Data-to-ASP.NET.aspx</feedburner:origLink></item></channel></rss>
