<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Scott Van Vliet</title><subtitle type="html">Less Talk, More Rock</subtitle><id>http://weblogs.asp.net/skillet/atom.aspx</id><link rel="alternate" type="text/html" href="http://weblogs.asp.net/skillet/default.aspx" /><link rel="self" type="application/atom+xml" href="http://weblogs.asp.net/skillet/atom.aspx" /><generator uri="http://communityserver.org" version="3.0.20510.895">Community Server</generator><updated>2006-11-22T10:11:00Z</updated><entry><title>IDataReader Extension Methods</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/skillet/archive/2008/06/18/idatareader-extension-methods.aspx" /><id>http://weblogs.asp.net/skillet/archive/2008/06/18/idatareader-extension-methods.aspx</id><published>2008-06-18T23:55:00Z</published><updated>2008-06-18T23:55:00Z</updated><content type="html">&lt;P&gt;First of all -- I'm a total liar.&amp;nbsp; I was supposed to offer up some great insight from Tech•Ed.&amp;nbsp; But alas, I had to leave early and fly to Seattle for a meeting.&amp;nbsp; So, I wasn't able to share any fun stuff :(&lt;/P&gt;
&lt;P&gt;We'll, I actually have a tiny bit of time to write, and I thought I'd share the result of recent code review.&lt;/P&gt;
&lt;P&gt;I'm currently teaching .NET (Framework fundamentals, C#, et al.) to some of my clients who are preparing to take over the support of a very large application (we're going on 2 years of development and deployment!) As we were looking at some of the code, I came across some stuff from our offshore team that slipped by my team's radar. In this particular project, we found hundreds of lines that looked like this:&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;theatre.ID = (reader["theatre_id"] is DBNull) ? &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/CODE&gt;&lt;CODE&gt;0 : Convert.ToInt32(reader["theatre_id"]); &lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;theatre.Code = (reader["theatre_code"] is DBNull) ? &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/CODE&gt;&lt;CODE&gt;String.Empty : reader["theatre_code"].ToString(); &lt;/CODE&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Ick!&amp;nbsp; I was very bummed to come across this while teaching my clients about best practice -- was a bit 'the fool'.&amp;nbsp; Not wanting to let this pass, I quickly redirected the discussion to talk about refactoring and reuse (which was kind of a nice segue to some OO topics.)&amp;nbsp; In this discussion, we wrote an Extension Method to the IDataReader class to clean-up this code.&amp;nbsp; The new code looked pretty:&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;theatre.ID = reader.GetValueOrDefault&amp;lt;int&amp;gt;("theatre_id"); &lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;theatre.Code = reader.GetValueOrDefault&amp;lt;string&amp;gt;("theatre_code");&lt;/CODE&gt; &lt;/P&gt;
&lt;P&gt;The details of this Extension Method are as follows:&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;/// &amp;lt;SUMMARY&amp;gt;&lt;BR&gt;/// Contains extension methods for the IDataReader interface. &lt;BR&gt;/// &amp;lt;/SUMMARY&amp;gt;&lt;BR&gt;public static class DataReaderExtender &lt;BR&gt;{ &lt;BR&gt;&amp;nbsp; /// &amp;lt;SUMMARY&amp;gt;&lt;BR&gt;&amp;nbsp; /// This method will return the value of the specified columnName, cast to &lt;BR&gt;&amp;nbsp; /// the type specified in T. However, if the value found in the reader is &lt;BR&gt;&amp;nbsp; /// DBNull, this method will return the default value of the type T. &lt;BR&gt;&amp;nbsp; /// &amp;lt;/SUMMARY&amp;gt;&lt;BR&gt;&amp;nbsp; /// &amp;lt;TYPEPARAM name="T"&amp;gt;The type to which the value found in the reader should be cast.&amp;lt;/TYPEPARAM&amp;gt; &lt;BR&gt;&amp;nbsp; /// &amp;lt;PARAM name="reader"&amp;gt;The reader in which columnName is found.&amp;lt;/PARAM&amp;gt; &lt;BR&gt;&amp;nbsp; /// &amp;lt;PARAM name="columnName"&amp;gt;The columnName to retrieve.&amp;lt;/PARAM&amp;gt; &lt;BR&gt;&amp;nbsp; /// &amp;lt;RETURNS&amp;gt;The column value within the reader typed as T.&amp;lt;/RETURNS&amp;gt; &lt;BR&gt;&amp;nbsp; &lt;/CODE&gt;&lt;CODE&gt;public static T GetValueOrDefault&amp;lt;T&amp;gt;(this IDataReader reader, string columnName)&lt;BR&gt;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/CODE&gt;&lt;CODE&gt;object columnValue = reader[columnName]; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; T returnValue = default(T); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!(columnValue is DBNull)) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/CODE&gt;&lt;CODE&gt;returnValue = (T)Convert.ChangeType(columnValue, typeof(T)); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return returnValue;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;/CODE&gt;&lt;CODE&gt;} &lt;BR&gt;} &lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;Enjoy! (I've posted the code here: &lt;A href="http://weblogs.asp.net/blogs/skillet/Code/DataReaderExtender.zip" mce_href="http://weblogs.asp.net/blogs/skillet/Code/DataReaderExtender.zip"&gt;DataReaderExtender.zip&lt;/A&gt;)&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6292979" width="1" height="1"&gt;</content><author><name>skillet</name><uri>http://weblogs.asp.net/members/skillet.aspx</uri></author><category term="C#" scheme="http://weblogs.asp.net/skillet/archive/tags/C_2300_/default.aspx" /><category term=".NET 3.5" scheme="http://weblogs.asp.net/skillet/archive/tags/.NET+3.5/default.aspx" /><category term="Extension Methods" scheme="http://weblogs.asp.net/skillet/archive/tags/Extension+Methods/default.aspx" /><category term="IDataReader" scheme="http://weblogs.asp.net/skillet/archive/tags/IDataReader/default.aspx" /></entry><entry><title>Hello from Tech·Ed</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/skillet/archive/2008/06/03/hello-from-tech-183-ed.aspx" /><id>http://weblogs.asp.net/skillet/archive/2008/06/03/hello-from-tech-183-ed.aspx</id><published>2008-06-03T14:55:00Z</published><updated>2008-06-03T14:55:00Z</updated><content type="html">&lt;P mce_keep="true"&gt;Hey everyone -- just got out of the &lt;A href="http://www.microsoft.com/events/teched2008/developer/default.mspx" target=_blank&gt;Tech·Ed &lt;/A&gt;2008 keynote and learned that this was Bill's last keynote as chairman of Microsoft... kind of cool to witness.&amp;nbsp; Was a good session, outlining SQL Server Data Services and some other stuff -- but nothing "new", per se.&amp;nbsp; But hopefully we'll see some good stuff in the sessions...&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;I'm off to a WPF session, and will be posting some tibdits as I find them.&amp;nbsp; Talk soon.&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6245103" width="1" height="1"&gt;</content><author><name>skillet</name><uri>http://weblogs.asp.net/members/skillet.aspx</uri></author><category term="General Software Development" scheme="http://weblogs.asp.net/skillet/archive/tags/General+Software+Development/default.aspx" /><category term="WPF" scheme="http://weblogs.asp.net/skillet/archive/tags/WPF/default.aspx" /><category term="Tech&amp;#183;Ed 2008" scheme="http://weblogs.asp.net/skillet/archive/tags/Tech_26002300_183_3B00_Ed+2008/default.aspx" /><category term="Silverlight" scheme="http://weblogs.asp.net/skillet/archive/tags/Silverlight/default.aspx" /></entry><entry><title>Live Search -- Cashback Infinite Redirect</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/skillet/archive/2008/05/22/live-search-cashback-infinite-redirect.aspx" /><id>http://weblogs.asp.net/skillet/archive/2008/05/22/live-search-cashback-infinite-redirect.aspx</id><published>2008-05-22T21:09:00Z</published><updated>2008-05-22T21:09:00Z</updated><content type="html">&lt;p&gt;
Classic... try it yourself: &lt;a href="http://search.live.com/cashback"&gt;http://search.live.com/cashback&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://weblogs.asp.net/blogs/skillet/Images/cashback.png" border="1" /&gt;&lt;/p&gt;
&lt;p&gt;
And I was all excited about getting some of that proverbial "fat cash".  (And yes, I tried this on both PC and Mac -- IE, Firefox and Safari!)&lt;/p&gt;
&lt;p&gt;
&lt;h3&gt;Update&lt;/h3&gt;
Working now -- must have been some last-minute host header redirect from msn.com to live.com (see the screenshot.)
&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6211392" width="1" height="1"&gt;</content><author><name>skillet</name><uri>http://weblogs.asp.net/members/skillet.aspx</uri></author><category term="Community News" scheme="http://weblogs.asp.net/skillet/archive/tags/Community+News/default.aspx" /><category term="General Software Development" scheme="http://weblogs.asp.net/skillet/archive/tags/General+Software+Development/default.aspx" /></entry><entry><title>Tom Brokaw -- C# or VB.NET?</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/skillet/archive/2008/02/28/tom-brokaw-c-or-vb-net.aspx" /><id>http://weblogs.asp.net/skillet/archive/2008/02/28/tom-brokaw-c-or-vb-net.aspx</id><published>2008-02-28T15:02:00Z</published><updated>2008-02-28T15:02:00Z</updated><content type="html">&lt;P mce_keep="true"&gt;Not sure why this hasn’t been covered yet on the blogosphere, but yesterday at Microsoft 2008 Launch Event, &lt;STRONG&gt;Tom Brokaw&lt;/STRONG&gt; gave a ~15 minute monologue about technology to introduce Steve Ballmer , the plight of our planet, and how technology (and those who deploy it) should be used for the greater good.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Tom Brokaw!&amp;nbsp; That’s right – TB; to introduce Visual Studio 2008 and other products.&amp;nbsp; Relevance?&amp;nbsp; I wonder if he’s a C# guy, or perhaps more of an IT Pro.&amp;nbsp; LMAO.&amp;nbsp; It was a cool experience, and quite different from the usual (a la Christopher Lloyd as Doc Brown in a De Lorean), which set the stage for this *unique* event.&lt;/P&gt;
&lt;P mce_keep="true"&gt;I’ve been to my share of launches and airlifts – and the most bizarre part about this one was – surprisingly not Brokaw – but the spandex-wearing “living art” performers that graced the walkway from the Nokia Live Theatre to the LA Convention Center.&amp;nbsp; It was something from an episode of The State.&lt;/P&gt;
&lt;P mce_keep="true"&gt;What did you think about the event?&amp;nbsp; Hyper-V does look awesome, and of course Visual Studio 2008 is bliss (we’ve been using it since RTM last November!)&amp;nbsp; Cheers.&lt;BR&gt;&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5878082" width="1" height="1"&gt;</content><author><name>skillet</name><uri>http://weblogs.asp.net/members/skillet.aspx</uri></author><category term="General Software Development" scheme="http://weblogs.asp.net/skillet/archive/tags/General+Software+Development/default.aspx" /><category term="Microsoft" scheme="http://weblogs.asp.net/skillet/archive/tags/Microsoft/default.aspx" /><category term="Visual Studio" scheme="http://weblogs.asp.net/skillet/archive/tags/Visual+Studio/default.aspx" /><category term=".NET" scheme="http://weblogs.asp.net/skillet/archive/tags/.NET/default.aspx" /></entry><entry><title>Looking for a Consulting Career in the Entertainment Industry?</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/skillet/archive/2007/09/27/looking-for-a-consulting-career-in-the-entertainment-industry.aspx" /><id>http://weblogs.asp.net/skillet/archive/2007/09/27/looking-for-a-consulting-career-in-the-entertainment-industry.aspx</id><published>2007-09-27T23:55:21Z</published><updated>2007-09-27T23:55:21Z</updated><content type="html">&lt;p&gt;Does working on projects for a movie studio sound exciting to you?  Do you want to parlay your consulting job into an acting career?  Do you have a garage band and want to drop your demo tape at your record label client's desk?  If you answered 'yes' to any of these questions, please read on! (All in jest, of course)
&lt;/p&gt;&lt;p&gt;We're currently looking for highly-skilled Microsoft Solution Developers to work on projects at our entertainment clients throughout Southern California.  Specifically, we're looking for go-getters with the following skillsets:
&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Solutions Developers (all levels) – C#, WinForms, ASP.NET, Web Service, WCF, SCSF (CAB), EntLib
&lt;/li&gt;&lt;li&gt;Database Developers (all levels) – SQL Server 2005 Integration Service (SSIS), Reporting Service (SSRS)
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;If you are interested, please send your resume ASAP to svanvliet[at]gmail[dot]com.  I will follow-up with a full job description and more details on our firm (one of the largest technology consulting and outsourcing companies in the world!)  Local candidates only, please.
&lt;/p&gt;&lt;p&gt;I look forward to hearing from you!&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=4220648" width="1" height="1"&gt;</content><author><name>skillet</name><uri>http://weblogs.asp.net/members/skillet.aspx</uri></author><category term="General Software Development" scheme="http://weblogs.asp.net/skillet/archive/tags/General+Software+Development/default.aspx" /><category term="Jobs" scheme="http://weblogs.asp.net/skillet/archive/tags/Jobs/default.aspx" /></entry><entry><title>Gaming Crosses Over to Real Life</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/skillet/archive/2007/08/06/gaming-crosses-over-to-real-life.aspx" /><id>http://weblogs.asp.net/skillet/archive/2007/08/06/gaming-crosses-over-to-real-life.aspx</id><published>2007-08-06T21:03:34Z</published><updated>2007-08-06T21:03:34Z</updated><content type="html">&lt;p&gt;So I've boarded my flight to DFW (en route to Orlando.)  Having been upgraded to First Class, (thank you elite status) I started getting comfortable in my bulk head isle seat (my favorite, of course.)  Just as I'm about to buckle-up, a gentleman asks if I'm too attached to my seat to move so that he and his buddy can sit together.  Now, I'm very cognizant of people who are jerks and can't move so that families and friends can sit together (I'll post on my recent Amsterdam to Los Angeles flight with wife and kids in tow later.)  Thus, I acquiesced and offered my seat to this gentleman.
&lt;/p&gt;&lt;p&gt;With a gracious "thank you," the guys proceeded to take their seats.  It was at this time that I noticed their shirts and bags, which donned the "&lt;a href="http://www.blizzard.com/blizzcon07/"&gt;BlizzCon&lt;/a&gt;" logo.  This brought me back to earlier, as I waited to board, when I heard some fellas talking about "the Horde" as if it were real life.  Knowing a little about World of Warcraft (WoW,) I quipped, "Just take it easy on me in WoW."  This is where it started.
&lt;/p&gt;&lt;p&gt;"You play?!" responded the gent.  "A little," I responded, which evoked, "What faction?  Alliance or Horde"
&lt;/p&gt;&lt;p&gt;"Uh, Alliance, I think?"
&lt;/p&gt;&lt;p&gt;"AAAAAAHHHHH… Take your seat back!" was the response from the two men, as the laughed out loud.
&lt;/p&gt;&lt;p&gt;Now, I'm a geek – no doubt.  But this was just crazy!  Nevertheless, I quickly put on my headphones and closed my eyes to escape the conversation I was not interested in having.
&lt;/p&gt;&lt;p&gt;About 5 minutes later, the man was rubber-necking to try and get my attention.
&lt;/p&gt;&lt;p&gt;"What server do you play on?  I'd like to give you some Gold for your seat."
&lt;/p&gt;&lt;p&gt;Holy shit… I couldn't believe that I was being offered FAKE money as a gift for my kindness!
&lt;/p&gt;&lt;p&gt;"Uh, I don't know."
&lt;/p&gt;&lt;p&gt;I had only signed up for a 14-day trial to WoW, and don't really have time to play any games these days.  But it just goes to show how gaming is widely becoming part of everyday life, and in some cases bleeding the edge of reality.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=3418037" width="1" height="1"&gt;</content><author><name>skillet</name><uri>http://weblogs.asp.net/members/skillet.aspx</uri></author></entry><entry><title>UTF8 Encoding Changes in Vista (Hashing Gotcha)</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/skillet/archive/2007/05/01/utf8-encoding-changes-in-vista-hashing-gotcha.aspx" /><id>http://weblogs.asp.net/skillet/archive/2007/05/01/utf8-encoding-changes-in-vista-hashing-gotcha.aspx</id><published>2007-05-02T03:45:00Z</published><updated>2007-05-02T03:45:00Z</updated><content type="html">&lt;p&gt;If you&amp;#39;ve used hashing to store passwords for your application, you may want to double-check you code to ensure it works on Vista. &lt;/p&gt;&lt;p&gt;Thanks to information found in &lt;a href="http://blogs.msdn.com/shawnste/archive/2006/06/16/634666.aspx"&gt;Shawn Steele&amp;#39;s post&lt;/a&gt; from almost a year ago, it seems Microsoft made changes in the .NET Framework for Vista to comply with the Unicode 5.0 specification, which requires invalid characters previously omitted in earlier versions of the .NET Framework for Windows XP, Server 2003, etc. As such, hashes computed on previous versions of Windows may not match hashes created on Vista. &lt;/p&gt;&lt;p&gt;For example, if you hash the string &amp;#39;&lt;span style="font-size: 10pt; color: #c00000; font-family: Consolas"&gt;Password&lt;/span&gt;&amp;#39; on Windows XP using &lt;span style="font-size: 10pt; color: #2b91af; font-family: Consolas"&gt;MD5CryptoServiceProvider&lt;/span&gt;, the hashed UTF8 string result would be &amp;#39;&lt;span style="font-size: 10pt; color: #c00000; font-family: Consolas"&gt;d~^g◄U7R&amp;uarr;!+9d&lt;/span&gt;&amp;#39;. Now, hashing the same value on Vista (without the fore mentioned solution) would result in &amp;#39;&lt;span style="font-size: 10pt; color: #c00000; font-family: Consolas"&gt;�d~�^g_�U7R_!+9d&lt;/span&gt;&amp;#39; as the UTF8 string output. Note the addition of the Unicode Replacement Character (&lt;span style="font-size: 10pt; color: #c00000; font-family: Consolas"&gt;\xFFFD&lt;/span&gt;) interspersed in the latter output. This is due to the fact that the Unicode 5.0 specification requires this character be provided rather than omitted, as allowed in Unicode 4.1 (implemented in the aforementioned previous versions of the .NET Framework for Windows.) &lt;/p&gt;&lt;p&gt;Now, as noted in Shawn&amp;#39;s post, you can yield the same results on Vista as previous versions of Windows using &lt;span style="font-size: 10pt; color: #2b91af; font-family: Consolas"&gt;EncoderFallback&lt;/span&gt; derived classes. These will allow you to specify non-default characters to use in place of the Unicode Replacement Character. For example, consider the following setup: &lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span style="color: #2b91af"&gt;Encoding&lt;/span&gt; encoding = &lt;span style="color: #2b91af"&gt;Encoding&lt;/span&gt;.UTF8.Clone() &lt;span style="color: blue"&gt;as&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Encoding&lt;/span&gt;;&lt;br /&gt;encoding.EncoderFallback = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;EncoderReplacementFallback&lt;/span&gt;(&lt;span style="color: blue"&gt;string&lt;/span&gt;.Empty);&lt;br /&gt;encoding.DecoderFallback = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;DecoderReplacementFallback&lt;/span&gt;(&lt;span style="color: blue"&gt;string&lt;/span&gt;.Empty);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;/span&gt;Based on the snippet above, the encoding will use an empty string for encoding/decoding; thus, the result would be the same as that from Windows XP in the previous example (which simply omitted by default.) &lt;/p&gt;&lt;p&gt;While this solution will work (had to make things work in an existing codebase,) I would recommend using Base64-encoding strings to store hashes, as they would not suffer from the same issues of invalid UTF8 characters. The same string, &amp;#39;&lt;span style="font-size: 10pt; color: #c00000; font-family: Consolas"&gt;Password&amp;#39;&lt;/span&gt;, hashed using bytes obtained from &lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span style="color: #2b91af"&gt;Encoding&lt;/span&gt;.UTF8.GetBytes(&lt;span style="color: blue"&gt;byte&lt;/span&gt;[])&lt;/span&gt; with or without the fallbacks yields &amp;#39;&lt;span style="font-size: 10pt; color: #c00000; font-family: Consolas"&gt;3GR+tl5nEeFVN1IYISs5ZA==&lt;/span&gt;&amp;#39; using &lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span style="color: #2b91af"&gt;Convert&lt;/span&gt;.ToBase64String(&lt;span style="color: blue"&gt;byte&lt;/span&gt;[])&lt;/span&gt;. &lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=2475965" width="1" height="1"&gt;</content><author><name>skillet</name><uri>http://weblogs.asp.net/members/skillet.aspx</uri></author><category term="Vista" scheme="http://weblogs.asp.net/skillet/archive/tags/Vista/default.aspx" /><category term="General Software Development" scheme="http://weblogs.asp.net/skillet/archive/tags/General+Software+Development/default.aspx" /></entry><entry><title>How-to: Change Windows Hostname and Keep Oracle 10g Running</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/skillet/archive/2007/04/03/how-to-change-windows-hostname-and-keep-oracle-10g-running.aspx" /><id>http://weblogs.asp.net/skillet/archive/2007/04/03/how-to-change-windows-hostname-and-keep-oracle-10g-running.aspx</id><published>2007-04-03T20:41:00Z</published><updated>2007-04-03T20:41:00Z</updated><content type="html">&lt;p&gt;So I realize it seems like I&amp;#39;m posting a bunch of stuff on Oracle and little on .NET, but it&amp;#39;s all related to a large Smart Client application we&amp;#39;re developing for our client, using Oracle 10g; thus, it&amp;#39;s relative &lt;span style="font-family: Wingdings"&gt;J&lt;/span&gt; &lt;/p&gt;&lt;p&gt;In a geographically-diverse team structure, it can be quite difficult to manage the development environment used by each team member (especially when you have little control over the workstation configuration of your offshore team.) Thus, for many of our engagements we heavily leverage virtualization &amp;ndash; specifically Virtual PC 2007 &amp;ndash; to help minimize the cost of environment setup and configuration. &lt;/p&gt;&lt;p&gt;One of the challenges we&amp;#39;ve faced with leveraging Virtual PC, specifically a shared image, is the unique naming of virtual machines. Now, in many cases it is acceptable to keep the virtual machine name the same across developer environments; however, for our purposes, unique machine names are required based on the following: &lt;/p&gt;&lt;ul&gt;&lt;li&gt;TFS Workspace names rely on machine name for unique naming (in combination with username) &lt;/li&gt;&lt;li&gt;Using our host VPN connection and Internet Connection Sharing (ICS), we provide our guest VPN access; although through NAT, the machine name (NetBIOS) still passes through when accessing corporate network resources, thus causing issues with the same &lt;/li&gt;&lt;li&gt;When using local network access directly on the guest, name conflicts occur; furthermore, two guest machines have issues accessing each other due to similar NetBIOS naming issues as outlined above (we often communicate guest-to-guest from different developer environments) &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;For all intents and purposes, this is a trivial matter. However, when dealing with Oracle, reliance on the installation-time hostname &amp;ndash; at least from my experience and research &amp;ndash; is critical. Thus, changing the hostname can cause problems. &lt;/p&gt;&lt;p&gt;Consequently, we&amp;#39;ve learned to deal with this process by following the steps outlined below. &lt;/p&gt;&lt;h3&gt;Step 1 &amp;ndash; Create Hosts Entry for Old Hostname &lt;/h3&gt;&lt;p&gt;Locate your hosts file, typically located at &lt;span style="font-size: 9pt; font-family: Courier New"&gt;%WINDIR%\system32\drivers\etc\hosts&lt;/span&gt; and add an entry for the old (current) &lt;span style="background-color: yellow"&gt;hostname&lt;/span&gt;. &lt;/p&gt;&lt;div&gt;&lt;table border="0" style="background: #eeece1; border-collapse: collapse"&gt;&lt;colgroup span="1"&gt;&lt;col span="1" style="width: 638px"&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody valign="top"&gt;&lt;tr&gt;&lt;td style="padding-right: 8px; padding-left: 8px; padding-bottom: 4px; padding-top: 4px; border: black 0.5pt solid"&gt;&lt;p&gt;&lt;span style="font-size: 9pt; font-family: Courier New"&gt;#&lt;br /&gt;# HOSTS file &lt;br /&gt;# &lt;br /&gt;&lt;br /&gt;&lt;span style="background-color: yellow"&gt;win2k3r2&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="background-color: aqua"&gt;172.16.10.10&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;Note the &lt;span style="background-color: aqua"&gt;IP address&lt;/span&gt; &amp;ndash; this is the address of a Loopback Adapter installed on the guest machine. As outlined by the Oracle Installer, a Loopback Adapter is required on systems that do not have a static IP address (as do virtual machines using NAT, etc.) &lt;/p&gt;&lt;h3&gt;Step 2 &amp;ndash; Uninstall Enterprise Manager Console &lt;/h3&gt;&lt;p&gt;Because there are configuration settings stored with Enterprise Manager Console that reference the hostname, the same must be uninstalled. &lt;/p&gt;&lt;div&gt;&lt;table border="0" style="background: #eeece1; border-collapse: collapse"&gt;&lt;colgroup span="1"&gt;&lt;col span="1" style="width: 638px"&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody valign="top"&gt;&lt;tr&gt;&lt;td style="padding-right: 8px; padding-left: 8px; padding-bottom: 4px; padding-top: 4px; border: black 0.5pt solid"&gt;&lt;p&gt;&lt;span style="font-size: 9pt; font-family: Courier New"&gt;emca -deconfig dbcontrol db -repos drop&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;Note, before executing this command, ensure that the Oracle instance is running &amp;ndash; it has to be in order for Enterprise Manager Configuration Assistance to drop the repository and de-configure the Console. &lt;/p&gt;&lt;h3&gt;Step 3 &amp;ndash; Stop All Oracle Services &lt;/h3&gt;&lt;p&gt;Once the uninstall of Enterprise Manage Console has completed, stop all Oracle Services on the guest machine. &lt;/p&gt;&lt;ul&gt;&lt;li&gt;iSQL*Plus Service &amp;ndash; typically named &lt;span style="text-decoration: underline"&gt;Oracle&amp;lt;OracleHomeName&amp;gt;iSQL*Plus&lt;/span&gt; &lt;/li&gt;&lt;li&gt;Oracle Listener Service &amp;ndash; typically named &lt;span style="text-decoration: underline"&gt;Oracle&amp;lt;OracleHomeName&amp;gt;TNSListener &lt;/span&gt;&lt;/li&gt;&lt;li&gt;Oracle Database Instance Service &amp;ndash; typically named &lt;span style="text-decoration: underline"&gt;OracleServer&amp;lt;SID&amp;gt;&lt;/span&gt; &lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Step 4 &amp;ndash; Update listener.ora and tnsnames.ora &lt;/h3&gt;&lt;p&gt;Once all the Oracle services have stopped, update the listener.ora and tnsnames.ora files, located in &lt;span style="font-size: 9pt; font-family: Courier New"&gt;%ORACLE_HOME%\network\admin&lt;/span&gt; to reflect the desired (new) hostname. &lt;/p&gt;&lt;div&gt;&lt;table border="0" style="background: #eeece1; border-collapse: collapse"&gt;&lt;colgroup span="1"&gt;&lt;col span="1" style="width: 638px"&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody valign="top"&gt;&lt;tr&gt;&lt;td style="padding-right: 8px; padding-left: 8px; padding-bottom: 4px; padding-top: 4px; border: black 0.5pt solid"&gt;&lt;p&gt;&lt;span style="font-size: 9pt; font-family: Courier New"&gt;LISTENER = &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Courier New"&gt;(DESCRIPTION_LIST = &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Courier New"&gt;(DESCRIPTION = &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Courier New"&gt;(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1)) &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Courier New"&gt;(ADDRESS = (PROTOCOL = TCP)(HOST = &lt;span style="background-color: yellow"&gt;win2k3r2&lt;/span&gt;)(PORT = 1521)) &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Courier New"&gt;) &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Courier New"&gt;)&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div&gt;&lt;table border="0" style="background: #eeece1; border-collapse: collapse"&gt;&lt;colgroup span="1"&gt;&lt;col span="1" style="width: 638px"&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody valign="top"&gt;&lt;tr&gt;&lt;td style="padding-right: 8px; padding-left: 8px; padding-bottom: 4px; padding-top: 4px; border: black 0.5pt solid"&gt;&lt;p&gt;&lt;span style="font-size: 9pt; font-family: Courier New"&gt;DEVBOX = &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Courier New"&gt;(DESCRIPTION = &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Courier New"&gt;(ADDRESS = (PROTOCOL = TCP)(HOST = &lt;span style="background-color: yellow"&gt;win2k3r2&lt;/span&gt;)(PORT = 1521)) &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Courier New"&gt;(CONNECT_DATA = &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Courier New"&gt;(SERVER = DEDICATED) &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Courier New"&gt;(SERVICE_NAME = devbox) &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Courier New"&gt;) &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Courier New"&gt;)&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;h3&gt;Step 5 &amp;ndash; Rename Host and Restart &lt;/h3&gt;&lt;p&gt;Now, rename the computer and restart the guest machine. &lt;/p&gt;&lt;h3&gt;Step 6 &amp;ndash; Ensure Oracle Instance is Running &lt;/h3&gt;&lt;p&gt;Once the guest machine has started up, log in and ensure the Oracle instance is running using the following command line (typically required, unless the instance, not the Windows Service, is configured to auto-start.) &lt;/p&gt;&lt;div&gt;&lt;table border="0" style="background: #eeece1; border-collapse: collapse"&gt;&lt;colgroup span="1"&gt;&lt;col span="1" style="width: 638px"&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody valign="top"&gt;&lt;tr&gt;&lt;td style="padding-right: 8px; padding-left: 8px; padding-bottom: 4px; padding-top: 4px; border: black 0.5pt solid"&gt;&lt;p&gt;&lt;span style="font-size: 9pt; font-family: Courier New"&gt;oradim -startup &amp;ndash;sid devbox&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;h3&gt;Step 7 &amp;ndash; Reinstall Enterprise Manager Console &lt;/h3&gt;&lt;p&gt;After ensuring the Oracle instance is running, reinstall Enterprise Manager Console using the following command line: &lt;/p&gt;&lt;div&gt;&lt;table border="0" style="background: #eeece1; border-collapse: collapse"&gt;&lt;colgroup span="1"&gt;&lt;col span="1" style="width: 638px"&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody valign="top"&gt;&lt;tr&gt;&lt;td style="padding-right: 8px; padding-left: 8px; padding-bottom: 4px; padding-top: 4px; border: black 0.5pt solid"&gt;&lt;p&gt;&lt;span style="font-size: 9pt; font-family: Courier New"&gt;emca -config dbcontrol db -repos create&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;h3&gt;Step 8 &amp;ndash; Validate Enterprise Manager Console Installation &lt;/h3&gt;&lt;p&gt;Lastly, after the successful installation of Enterprise Manager Console, validate the installation by navigating to the logon page &amp;ndash; typically &lt;a href="http://localhost:1158/em/"&gt;&lt;span style="font-size: 9pt; font-family: Courier New"&gt;http://&amp;lt;hostname&amp;gt;:1158/em/&lt;/span&gt;&lt;/a&gt;. &lt;/p&gt;&lt;p&gt;At this point, you should be crankin&amp;#39; away with your Oracle instance running as it should! We spent a lot of time working on this issue, so hopefully this post helps you out in some way &amp;ndash; I wished there was an article like this when I was scouring &lt;a href="http://otn.oracle.com/"&gt;OTN&lt;/a&gt; with no results! &lt;/p&gt;&lt;p&gt;Thanks to Mike Huffine for the initial pointers.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=2172897" width="1" height="1"&gt;</content><author><name>skillet</name><uri>http://weblogs.asp.net/members/skillet.aspx</uri></author><category term="Oracle" scheme="http://weblogs.asp.net/skillet/archive/tags/Oracle/default.aspx" /><category term="General Software Development" scheme="http://weblogs.asp.net/skillet/archive/tags/General+Software+Development/default.aspx" /></entry><entry><title>こんにちは東京から / Hello from Tokyo!</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/skillet/archive/2007/03/25/hello-from-tokyo.aspx" /><id>http://weblogs.asp.net/skillet/archive/2007/03/25/hello-from-tokyo.aspx</id><published>2007-03-25T12:48:00Z</published><updated>2007-03-25T12:48:00Z</updated><content type="html">&lt;p&gt;This is my first time visiting Japan, and it&amp;#39;s already been an incredible experience. Dinner tonight was an interesting blend of Japanese fare, most of which tasted completely unfamiliar. And the long ride from Narita to the Westin Tokyo allowed me to view some of the city&amp;#39;s multifaceted beauty. &lt;/p&gt;&lt;p&gt;Tokyo is the start of my mini World Tour of client meetings; I&amp;#39;m off to Hong Kong in a couple days, then to Mumbai only a day later. Stay tuned for more interesting musings.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=2091849" width="1" height="1"&gt;</content><author><name>skillet</name><uri>http://weblogs.asp.net/members/skillet.aspx</uri></author><category term="Personal" scheme="http://weblogs.asp.net/skillet/archive/tags/Personal/default.aspx" /></entry><entry><title>Excellent Vista Feature – Additional Clocks</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/skillet/archive/2007/03/21/excellent-vista-feature-additional-clocks.aspx" /><id>http://weblogs.asp.net/skillet/archive/2007/03/21/excellent-vista-feature-additional-clocks.aspx</id><published>2007-03-22T00:49:00Z</published><updated>2007-03-22T00:49:00Z</updated><content type="html">&lt;p&gt;It&amp;#39;s now been over 2 months since I began using Vista as my primary OS, and to-date I&amp;#39;ve experienced nothing but end-user bliss &lt;span style="font-family: Wingdings"&gt;J&lt;/span&gt; There are so many cool features to which I&amp;#39;m really growing attached &amp;ndash; it would be rather difficult to revert to XP. One of these excellent features is Additional Clocks in the Date and Time Settings. This feature allows you to add two additional clocks to the task bar, providing a view of alternate time zones in two of the following ways: &lt;/p&gt;&lt;p&gt;Mouse hover: &lt;/p&gt;&lt;p&gt;&lt;img alt="Hover" border="0" height="119" src="http://images.scottvanvliet.com/blog/vista-clocks-hover.jpg" style="width: 209px; height: 119px" title="Hover" width="209" /&gt;&lt;/p&gt;&lt;p&gt;Single-click: &lt;/p&gt;&lt;p&gt;&lt;img border="0" height="282" src="http://images.scottvanvliet.com/blog/vista-clocks.jpg" style="width: 576px; height: 282px" width="576" /&gt;&lt;/p&gt;&lt;p&gt;With team members and clients spread across the globe, this feature is greatly appreciated! Now I don&amp;#39;t have to keep Yahoo! Widgets or Google Gadgets around for this sort of thing.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=2076682" width="1" height="1"&gt;</content><author><name>skillet</name><uri>http://weblogs.asp.net/members/skillet.aspx</uri></author><category term="Vista" scheme="http://weblogs.asp.net/skillet/archive/tags/Vista/default.aspx" /></entry><entry><title>TF.exe Goodness – Move Multiple Files/Folders</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/skillet/archive/2007/02/02/tf-exe-goodness-move-multiple-files-folders.aspx" /><id>http://weblogs.asp.net/skillet/archive/2007/02/02/tf-exe-goodness-move-multiple-files-folders.aspx</id><published>2007-02-02T17:36:11Z</published><updated>2007-02-02T17:36:11Z</updated><content type="html">&lt;p&gt;Here's a quick tip: if you need to move multiple files or folders in Team Explorer, it's not possible to select multiple and click 'Move' from the context menu.   However, you can accomplish this using the TF.exe Move command with a wildcard:
&lt;/p&gt;&lt;p&gt;&lt;span style="text-decoration:underline"&gt;Syntax&lt;/span&gt;: &lt;br/&gt;&lt;span style="color:#76923c; font-family:Consolas; font-size:10pt"&gt;&lt;br/&gt;tf.exe move &amp;lt;itemspec&amp;gt; &amp;lt;destination&amp;gt;
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="text-decoration:underline"&gt;Example&lt;/span&gt;:&lt;br/&gt;&lt;span style="color:#76923c; font-family:Consolas; font-size:10pt"&gt;&lt;br/&gt;tf.exe move $/Itd/Deployment/Builds/R1* $/Itd/Deployment/Builds/Archive
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Sweet and simple!  This one saved me a lot of time – Enjoy! &lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=1523172" width="1" height="1"&gt;</content><author><name>skillet</name><uri>http://weblogs.asp.net/members/skillet.aspx</uri></author><category term="Team System" scheme="http://weblogs.asp.net/skillet/archive/tags/Team+System/default.aspx" /></entry><entry><title>How to Drop an Oracle Schema / User locked by ASP.NET</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/skillet/archive/2007/01/23/how-to-drop-an-oracle-schema-user-locked-by-asp-net.aspx" /><id>http://weblogs.asp.net/skillet/archive/2007/01/23/how-to-drop-an-oracle-schema-user-locked-by-asp-net.aspx</id><published>2007-01-23T22:01:00Z</published><updated>2007-01-23T22:01:00Z</updated><content type="html">&lt;p&gt;As part of our configuration management process with our offshore team, we often have to recreate our database schema in Oracle by dropping the schema owner and recreating that user as part of the create/import scripts delivered with a build. However, when trying to perform this task in our onshore Development, QA or UAT environments we are faced with an issue where the user could not be dropped due to the fact that said user was currently connected: &lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt; color: #76923c; font-family: Consolas"&gt;DROP USER &amp;lt;user_to_drop&amp;gt; CASCADE &lt;br /&gt;*&lt;br /&gt;ERROR at line 1:&lt;br /&gt;ORA-01940: cannot drop a user that is currently connected &lt;/span&gt;&lt;/p&gt;&lt;p&gt;However, when checking the &lt;span style="font-size: 10pt; color: #76923c; font-family: Consolas"&gt;V$SESSION&lt;/span&gt; system table, the user was not listed as being connected or having an active session with the database. Perplexed, we looked around at some other clues, and determined that while the user did not have an active session with the database, its connection was still valid and pooled by the ASP.NET Web process. Thus, we recycled the AppPool in which the application was hosted and &amp;ndash; viola! The drop succeeded. &lt;/p&gt;&lt;p&gt;We&amp;#39;ve now automated this process and recycle the AppPool programmatically. Below is the Web service used to list the available AppPools and individually recycle them. &lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Consolas"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt; System;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Consolas"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt; System.Web;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Consolas"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt; System.Web.Services;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Consolas"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt; System.Web.Services.Protocols;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Consolas"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt; System.DirectoryServices;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Consolas"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt; System.Collections.Generic;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;[&lt;span style="color: teal"&gt;WebService&lt;/span&gt;(Namespace = &lt;span style="color: maroon"&gt;&amp;quot;http://tempuri.org&amp;quot;&lt;/span&gt;)]&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;[&lt;span style="color: teal"&gt;WebServiceBinding&lt;/span&gt;(ConformsTo = &lt;span style="color: teal"&gt;WsiProfiles&lt;/span&gt;.BasicProfile1_1)]&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Consolas"&gt;public&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; AppServerService : System.Web.Services.&lt;span style="color: teal"&gt;WebService&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;{&lt;span style="color: gray"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; AppServerService () &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;span style="color: green"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; color: gray; font-family: Consolas"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue"&gt;private&lt;/span&gt; &lt;span style="color: blue"&gt;const&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt; AppPoolDirectoryEntryPath = &lt;span style="color: maroon"&gt;&amp;quot;IIS://localhost/W3SVC/AppPools&amp;quot;&lt;/span&gt;;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; color: gray; font-family: Consolas"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;[&lt;span style="color: teal"&gt;WebMethod&lt;/span&gt;]&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: teal"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&amp;gt; GetAppPoolNames()&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: teal"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&amp;gt; appPoolList = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: teal"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&amp;gt;();&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue"&gt;using&lt;/span&gt; (DirectoryEntry appPoolEntry = &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span style="color: blue"&gt;&lt;font color="#000000"&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; &lt;/font&gt;new&lt;/span&gt; DirectoryEntry(AppPoolDirectoryEntryPath))&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&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&gt;&lt;span style="color: blue"&gt;foreach&lt;/span&gt; (DirectoryEntry appPool &lt;span style="color: blue"&gt;in&lt;/span&gt; appPoolEntry.Children)&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&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&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&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; &lt;/span&gt;appPoolList.Add(appPool.Name);&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&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; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&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; &lt;/span&gt;appPool.Close();&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&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; &lt;/span&gt;appPool.Dispose();&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&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&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue"&gt;return&lt;/span&gt; appPoolList;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;[&lt;span style="color: teal"&gt;WebMethod&lt;/span&gt;]&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: teal"&gt;AppPoolRestartResponse&lt;/span&gt; RecycleAppPool(&lt;span style="color: blue"&gt;string&lt;/span&gt; appPoolName)&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue"&gt;if&lt;/span&gt; (appPoolName == &lt;span style="color: blue"&gt;null&lt;/span&gt;)&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&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&gt;&lt;span style="color: blue"&gt;throw&lt;/span&gt; &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: teal"&gt;ArgumentNullException&lt;/span&gt;(&lt;span style="color: maroon"&gt;&amp;quot;appPoolName&amp;quot;&lt;/span&gt;);&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: teal"&gt;AppPoolRestartResponse&lt;/span&gt; response = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: teal"&gt;AppPoolRestartResponse&lt;/span&gt;();&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue"&gt;using&lt;/span&gt; (&lt;span style="color: teal"&gt;DirectoryEntry&lt;/span&gt; appPool = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: teal"&gt;DirectoryEntry&lt;/span&gt;(&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&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; &lt;span style="color: teal"&gt;String&lt;/span&gt;.Format(&lt;span style="color: maroon"&gt;&amp;quot;{0}/{1}&amp;quot;&lt;/span&gt;, AppPoolDirectoryEntryPath, appPoolName)))&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&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&gt;&lt;span style="color: blue"&gt;try&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&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&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&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; &lt;/span&gt;appPool.Invoke(&lt;span style="color: maroon"&gt;&amp;quot;Recycle&amp;quot;&lt;/span&gt;);&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&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; &lt;/span&gt;response.Successful = &lt;span style="color: blue"&gt;true&lt;/span&gt;;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&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; &lt;/span&gt;response.Message = &lt;span style="color: teal"&gt;String&lt;/span&gt;.Format(&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&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; &lt;span style="color: maroon"&gt;&amp;quot;Application Pool \&amp;quot;{0}\&amp;quot; was recycled succesfully at {1:HH:mm:ss}.&amp;quot;&lt;/span&gt;, &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&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;appPool.Name, &lt;span style="color: teal"&gt;DateTime&lt;/span&gt;.Now);&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&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&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&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&gt;&lt;span style="color: blue"&gt;catch&lt;/span&gt; (&lt;span style="color: teal"&gt;Exception&lt;/span&gt; e)&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&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&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&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; &lt;/span&gt;response.Successful = &lt;span style="color: blue"&gt;true&lt;/span&gt;;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&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; &lt;/span&gt;response.Message = &lt;span style="color: teal"&gt;String&lt;/span&gt;.Format(&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&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; &lt;span style="color: maroon"&gt;&amp;quot;Application Pool \&amp;quot;{0}\&amp;quot; failed to recycle: \&amp;quot;{1}\&amp;quot;.&amp;quot;&lt;/span&gt;, &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&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; appPool.Name, e.Message);&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&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&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue"&gt;return&lt;/span&gt; response;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: green"&gt; &lt;/span&gt;&lt;span style="color: gray"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: green"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: green"&gt; &lt;/span&gt;&lt;span style="color: gray"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; AppPoolRestartResponse&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue"&gt;private&lt;/span&gt; &lt;span style="color: blue"&gt;bool&lt;/span&gt; _successful;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue"&gt;private&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt; _message;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;bool&lt;/span&gt; Successful&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&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&gt;&lt;span style="color: blue"&gt;get&lt;/span&gt; { &lt;span style="color: blue"&gt;return&lt;/span&gt; _successful; }&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&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&gt;&lt;span style="color: blue"&gt;set&lt;/span&gt; { _successful = &lt;span style="color: blue"&gt;value&lt;/span&gt;; }&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt; Message&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&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&gt;&lt;span style="color: blue"&gt;get&lt;/span&gt; { &lt;span style="color: blue"&gt;return&lt;/span&gt; _message; }&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&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&gt;&lt;span style="color: blue"&gt;set&lt;/span&gt; { _message = &lt;span style="color: blue"&gt;value&lt;/span&gt;; }&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 10pt; font-family: Consolas"&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Note that in order for this Web service to work correctly, you must be authenticated to the Web service as an local administrator of the machine, or enable impersonation in Web.config for a user with the appropriate privelleges. &lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=1458768" width="1" height="1"&gt;</content><author><name>skillet</name><uri>http://weblogs.asp.net/members/skillet.aspx</uri></author><category term="ASP.NET" scheme="http://weblogs.asp.net/skillet/archive/tags/ASP.NET/default.aspx" /><category term="Oracle" scheme="http://weblogs.asp.net/skillet/archive/tags/Oracle/default.aspx" /></entry><entry><title>Team Foundation Server Merge Woes – TF14087</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/skillet/archive/2007/01/14/team-foundation-server-merge-woes-tf14087.aspx" /><id>http://weblogs.asp.net/skillet/archive/2007/01/14/team-foundation-server-merge-woes-tf14087.aspx</id><published>2007-01-14T19:47:00Z</published><updated>2007-01-14T19:47:00Z</updated><content type="html">&lt;p&gt;In early 2006, we had a difficult bridge to cross as we were about to enter the Construction phase of our current project.  Having 35+ developers building interdependent functional areas of the application, we needed to ensure the autonomy of each functional area, whilst maintaining linkage between shared components.  Thus, having used branches in the past (quite successfully with Subversion, might I add,) we decided to leverage TFS branches to provide support for our concurrent development efforts.
&lt;/p&gt;&lt;p&gt;While quite sound in theory, this has proven to be quite challenging in practice.  We've faced several issues, most troubling of which is error TF14087: 
&lt;/p&gt;&lt;p&gt;&lt;span style="color:#4f6228; font-family:Consolas; font-size:10pt"&gt;TF14087: Cannot undelete '$/Itd/Implementation/R2/Bvi/Framework/Security/Authorization/Principal.cs' because not all of the deletion is being undeleted.
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;After some research into this error, I came across &lt;a href="http://blogs.msdn.com/mrod/archive/2006/10/10/The-logic-and-reason-behind-error-message-TF14087.aspx"&gt;this excellent explanation&lt;/a&gt; of what's going on.  Furthermore, we found that the reason for this error occurring in our structure is due to file renaming in the trunk and branches.   Thus, as the aforementioned blog post outlines, TFS cannot perform the merge as the linkage between the file is not correctly synchronized (TFS is looking to merge a "deleted" file, although it's really been renamed.)
&lt;/p&gt;&lt;p&gt;Furthermore, we also faced issues in that some developers "merged" their branch by copying files locally in their workspace and added them to Source Control as new items.  This completely breaks the linkage between the trunk and branches, which was a big headache when trying to perform the merge.
&lt;/p&gt;&lt;p&gt;In the end, we spent more than 4 hours manually merging our two active branches – what a pain!  Even though there are some workarounds posted out there (&lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=596187&amp;amp;SiteID=1"&gt;here is a fair approach&lt;/a&gt;,) we ended up performing the merge manually due to the fact that some defects had been fixed in one branch while other defects in the next branch.  Thus, the only way to effectively manage said changes was to manually merge.
&lt;/p&gt;&lt;p&gt;Although I'm now a little jaded with TFS Branching, I would recommend the following guidelines if you choose to use this functionality to manage concurrent development activities:
&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="text-decoration:underline"&gt;Merge often&lt;/span&gt; – this is a big one, since many of our issues would have been resolved if this rule was followed by our team.
&lt;/li&gt;&lt;li&gt;&lt;span style="text-decoration:underline"&gt;Rename in trunk, then move to branches&lt;/span&gt; – we found that whenever a rename was required, performing this activity in the trunk allowed us to propagate changes to the desired branch without merge errors
&lt;/li&gt;&lt;li&gt;&lt;span style="text-decoration:underline"&gt;Document merge guidelines&lt;/span&gt; – in our situation, we have 35+ developers offshore with some architecture and development oversight resources onshore.  Although some resources had used branches before, many were unfamiliar with the process, resulting in the merge-via-copy-and-paste snafu.  Thus, clearly documenting the process could have saved us the headaches we've had.
&lt;/li&gt;&lt;li&gt;&lt;span style="text-decoration:underline"&gt;Keep shared components in single branch&lt;/span&gt; – we found that fewer conflicts existed in shared components.  Thus, keeping these items in a single branch reduces the margin for error in merging.
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;In addition to these tips, it is always a good idea to effectively communicate major changes to the code base between the development teams.  We're currently implementing a weekly meeting between team leads to discuss the same, and it's looking bright. 
&lt;/p&gt;&lt;p&gt;Recommended reading:&lt;br/&gt;&lt;a href="http://blogs.msdn.com/mrod/archive/2006/10/10/The-logic-and-reason-behind-error-message-TF14087.aspx"&gt;The logic and reason behind error message TF14087&lt;/a&gt; (mentioned earlier)
&lt;/p&gt;&lt;p&gt;Cheers.
&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=1406616" width="1" height="1"&gt;</content><author><name>skillet</name><uri>http://weblogs.asp.net/members/skillet.aspx</uri></author><category term="Team System" scheme="http://weblogs.asp.net/skillet/archive/tags/Team+System/default.aspx" /><category term="TFS" scheme="http://weblogs.asp.net/skillet/archive/tags/TFS/default.aspx" /></entry><entry><title>Hello from Heathrow!</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/skillet/archive/2007/01/05/hello-from-heathrow.aspx" /><id>http://weblogs.asp.net/skillet/archive/2007/01/05/hello-from-heathrow.aspx</id><published>2007-01-05T18:43:00Z</published><updated>2007-01-05T18:43:00Z</updated><content type="html">&lt;p&gt;It seems like the only time I have to myself is in airport lounges!&amp;nbsp; As the post would suggest, I&amp;#39;m in the UK en route to Mumbai to visit my team, check up on things, enjoy some good Chicken Tikka... the usual drill.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Will be posting some TFS musings soon... hopefully, will have some goodies on SP1 and hardware migration.&lt;/p&gt;&lt;p&gt;Cheers!&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=1366748" width="1" height="1"&gt;</content><author><name>skillet</name><uri>http://weblogs.asp.net/members/skillet.aspx</uri></author><category term="Team System" scheme="http://weblogs.asp.net/skillet/archive/tags/Team+System/default.aspx" /></entry><entry><title>For Feedback via this Blog, Use Contact Form</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/skillet/archive/2006/11/22/for-feedback-via-this-blog-use-the-contact-form.aspx" /><id>http://weblogs.asp.net/skillet/archive/2006/11/22/for-feedback-via-this-blog-use-the-contact-form.aspx</id><published>2006-11-22T18:11:00Z</published><updated>2006-11-22T18:11:00Z</updated><content type="html">&lt;p&gt;My inbox has been chock full of spam feedback from this blog, which unfortunately captures valid comments and feedback that sometimes requires my response.&amp;nbsp; As such, I&amp;#39;ve disabled email notifications&amp;nbsp;for comments.&amp;nbsp; So, if you&amp;#39;ve got questions or feedback for which you&amp;#39;d like a response, please use the Contact form on this blog.&lt;/p&gt;&lt;p&gt;&amp;nbsp;Thanks!&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=999236" width="1" height="1"&gt;</content><author><name>skillet</name><uri>http://weblogs.asp.net/members/skillet.aspx</uri></author></entry></feed>