<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>C# Tea Time</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/eric/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/eric/feed.xml</link>
    <description>Random ramblings on C#, life at Microsoft, and other technology facets I find interesting.</description>
    <lastBuildDate>Tue, 16 Apr 2019 05:07:03 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Keeping master history clean</title>
      <link>https://docs.microsoft.com/archive/blogs/eric/keeping-master-history-clean</link>
      <pubDate>Sun, 11 Oct 2015 13:12:00 GMT</pubDate>
      <dc:creator><![CDATA[eric.maino@hotmail.com]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/eric/2015/10/11/keeping-master-history-clean/</guid>
      <description><![CDATA[On a previous team we moved from using our own internal source control provider to Git. Having never...]]></description>
      <content:encoded><![CDATA[<div>On a previous team we moved from using our own internal source control provider to Git. Having never used Git myself at the time I was excited to try something new. I instantly fell in love.</div>
<p>&nbsp;</p>
<div>Unfortunately not everyone on the team fell in love and many were still operating as if they were using traditional source control. Mistakes were getting made daily, poor commits were being pushed the server as well as bad merges. It got to the point that the team was locking master down at least once a day to clean it up. Eventually I was fed up and decided this problem is easily solvable with a script.</div>
<p>&nbsp;</p>
<div>As a team we had agreed on the following:</div>
<ul>
<li>History should be linear</li>
</ul>
<div><strong>What do you mean by linear history?</strong><br />The history must only have one path can be followed. I've shared a few commits below that should make this easier to visualize.</div>
<div><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/46/73/8510.gitmerge.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-46-73/8510.gitmerge.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/46/73/8510.gitmerge.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/232x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-46-73/8510.gitmerge.png" alt="" border="0" /></a></div>
<div>Figure A, represents a clean linear history with no branches.<br />Figure B, represents a clean linear history with a simple branch. This is still considered linear because there are no overlapping commits. This is an example of what the history might look like when performing --no-ff merges.<br />Figure C, represents an invalid commit. The second commit from the top is out of place. No two commits should be able to have the same parent and child<br />Figure D, also represents an invalid commit . The second commit from the top is out of place.<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />The first version of the validation script was simple:</div>
<div><code> git fetch origin +master:master</code></div>
<div><code>git checkout master</code></div>
<div><code>git merge --ff-only %SourceRef%</code></div>
<p>&nbsp;</p>
<div>The above script worked great to ensure master maintained a clean history. Commits similar in shape to figures A and B would merge cleanly into master, but there were still problems.&nbsp;</div>
<ul>
<li>Users were still pushing commits with default user name and email</li>
<li>Commits were pushed with poor messages</li>
<li>Advanced users wanted to use --no-ff merges the above script was destroying the history</li>
</ul>
<div>After investigating the issues a more complex PowerShell script was developed that could be run as part of the check-in process (another post coming shortly). This evolved script did a great job catching the common mistakes we were making as a team and has since kept master clean.</div>
<div>The evolved script can be found here:<a href="https://github.com/ericmaino/Scripts/blob/master/MergeClean.ps1"> https://github.com/ericmaino/Scripts/blob/master/MergeClean.ps1</a></div>]]></content:encoded>
    </item>
    <item>
      <title>Environment Agnostic Tests</title>
      <link>https://docs.microsoft.com/archive/blogs/eric/environment-agnostic-tests</link>
      <pubDate>Sun, 27 Apr 2008 14:11:41 GMT</pubDate>
      <dc:creator><![CDATA[Eric]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/eric/2008/04/27/environment-agnostic-tests/</guid>
      <description><![CDATA[What is an environment agnostic test?     This is a test which will execute successfully no matter...]]></description>
      <content:encoded><![CDATA[<p><strong>What is an environment agnostic test?</strong>     <br />This is a test which will execute successfully no matter how the environment is configured assuming that the product which you intend to test is available on the machine.</p>  <p><strong>What are some possible environment variables?      <br /></strong>Operating system, platform, OS language, product language, product sku, product settings, additional applications, etc.</p>  <p>As seen here there are many variables and one thing that my team expects is that our tests will execute the exact same way under all circumstances providing that the test is executing in a supported scenario. This leads to a rather large automation matrix that must be tested against before we ship (this will be another post), but it also leads to a very well defined and efficient test infrastructure.</p>  <p>The above expectation sparked a discussion because we were executing a joint run that included both VB IDE and C# IDE tests, which resulted in some of the C# tests failing. They were failing because in order to execute a joint run with both VB and C# tests, all tests must execute under the VB profile. All tests must execute under this profile, because the VB tests are not environment agnostic (yet!) and all of the C# tests are (well should be).</p>  <p>We will be discussing this topic more in our team meeting on Monday in order to assure we are all on the same page and I will make it one of my missions over the next few months to ensure my teams tests will execute flawlessly under any supported circumstances.</p>  <p>My questions for you are what kind of tests do you execute? What expectations do you have for your environment? Have you had similar discussions at your company?</p>]]></content:encoded>
    </item>
    <item>
      <title>DevDiv Source Control</title>
      <link>https://docs.microsoft.com/archive/blogs/eric/devdiv-source-control</link>
      <pubDate>Sat, 12 Apr 2008 23:38:46 GMT</pubDate>
      <dc:creator><![CDATA[Eric]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/eric/2008/04/12/devdiv-source-control/</guid>
      <description><![CDATA[A question that I was recently asked on a trip was what source control system we use and what it...]]></description>
      <content:encoded><![CDATA[<p>A question that I was recently asked on a trip was what source control system we use and what it looks like. I've spent quite a bit of time in this space for our team and will try to answer the question with this post.</p>  <p><strong>What source control provider does your team use?      <br /></strong>During the Visual Studio 2008 product cycle the primary tool for source control was an internal tool called Source Depot. While not all teams used Source Depot, yes some used TFS, it was the primary source control provider and it was what most of the internal tools were built against and we didn't have time to rebuild them to completely target TFS. Any important branch, Main, Beta1, Beta2, RTM&#160; was in Source Depot. The move had started though... we are beginning to dogfood TFS and tools where getting ported.</p>  <p>Once 2008 was shipped the entire division focused on moving to TFS. This is now the only supported source control provider moving forward for new and future work. We will continue to support Source Depot for a while as our 2003, 2005 and 2008 source code lives there and we must continue to support those products.</p>  <p><strong>What does your source control structure look like?</strong>     <br />Generally our source code tree is about 3 levels deep. The top level root branch is referred to as Main, child branches of Main are referred to as Product Unit (PU) branches and child branches of PU branches are referred to as feature branches. Some teams have one PU branch and one feature branch. These teams generally just use the PU branch as a staging area when taking integrations up or down. Other teams will have multiple feature branches that will regularly integrate up to the PU when their work is complete. It's often interesting for individuals to see that each PU within the division functions as their own entity handling check-ins, integrations, builds and the number of branches differently. While most of the teams function in a similar fashion almost every team has some quirk in their process. My team as long as I have been a part of it follows the single feature branch and single PU branch model.</p>  <p><strong>How many integration\merge conflicts do you normally have to deal with?      <br /></strong>This really depends on how the branch structure is setup and how much your team needs to change shared code vs. team specific code. Generally I would say the number of conflicts my team sees on average is around 30 - 40. Though the other day when I was doing an integration of QA code only I had around 5,000 conflicts. Fortunately I didn't have to resolve each of these by hand, because the owner of the files just said they wanted to take what ever was in the destination branch and to ignore the incoming changes. This was a blessing.</p>  <p><strong>Is your test code under source control and if so where do the sources live?      <br /></strong>Yes all of our test code is under source control. It is treated very similar to the product code and is branched with the product code. While this was probably the answer that you expected the test code has not always lived with the product nor was it branched accordingly. This was a recent change in the last three years. I feel this was the correct change, though I still feel some in the division might not agree. When we added the test sources to the product source control I believe it almost double the size of the depot in size and tripled the number of files.</p>  <p><strong>How long does it take to sync all of Main?</strong>     <br />I don't have any data on this. I will work on getting some and make another post out of it in the future.</p>]]></content:encoded>
    </item>
    <item>
      <title>Disposing Your Finalizers</title>
      <link>https://docs.microsoft.com/archive/blogs/eric/disposing-your-finalizers</link>
      <pubDate>Wed, 09 Apr 2008 13:16:22 GMT</pubDate>
      <dc:creator><![CDATA[Eric]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/eric/2008/04/09/disposing-your-finalizers/</guid>
      <description><![CDATA[.csharpkeyword
    {
        color: #0000ff;
    }
    .csharptype
    {...]]></description>
      <content:encoded><![CDATA[<style type="text/css">

    .csharpkeyword
    {
        color: #0000ff;
    }
    .csharptype
    {
        color: #2b91af;
    }</style>  <p>Yesterday I was bitten by a bug in our test infrastructure where the code was attempting to dispose of an object in the finalize method. It took me a bit longer then I had hoped to track down the issues, but in the end I did track it down and fixed it.</p>  <p>Here is some example code where the bug exists:</p>  <p style="font-size: small; font-family: &#39;Courier New&#39;"><span class="csharpkeyword">class</span> <span class="csharptype">Logger</span> : <span class="csharptype">IDisposable</span>     <br />{     <br />&#160;&#160;&#160; <span class="csharpkeyword">private</span> <span class="csharptype">StreamWriter</span> Log { get; set; }     <br />    <br />&#160;&#160;&#160; <span class="csharpkeyword">public</span> Logger(<span class="csharptype">FileInfo</span> file)     <br />&#160;&#160;&#160; {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Log = <span class="csharptype">File</span>.CreateText(file.FullName);     <br />&#160;&#160;&#160; }     <br />    <br />&#160;&#160;&#160; <span class="csharpkeyword">public void</span> Write(string msg)     <br />&#160;&#160;&#160; {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Log.WriteLine(msg);     <br />&#160;&#160;&#160; }     <br />    <br />&#160;&#160;&#160; ~Logger()     <br />&#160;&#160;&#160; {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Dispose();     <br />&#160;&#160;&#160; }     <br />    <br />&#160;&#160;&#160; <span class="csharpkeyword">public void</span> Dispose()     <br />&#160;&#160;&#160; {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="csharpkeyword">if</span> (Log != null)     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Log.Dispose();     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Log = null;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="csharptype">GC</span>.SuppressFinalize(<span class="csharpkeyword">this</span>);     <br />&#160;&#160;&#160; }     <br />}</p>  <p>You may be looking at this code and asking what is wrong even after you glance over the <a href="https://msdn.microsoft.com">MSDN</a> article, <a href="https://msdn2.microsoft.com/en-us/library/ddae83kx.aspx">Overriding the Finalize Method</a>. The first sentence of the article is, &quot;A Finalize method acts as a safeguard to clean up resources in the event that your Dispose method is not called.&quot; At a quick glance one might think the following. A dispose method is designed to be called multiple times without adversely affecting the object and the framework has a notion of a Finalize method that will always be called, so why don't I just call the Dispose method from Finalize?</p>  <p>The reason that you never want to call a Dispose method from a Finalize method is that the Finalize method was implemented to ensure that all <strong>unmanaged</strong> resources are cleaned up since the GC cannot handle these. Since the GC is allowed to clean up/finalize managed resources in which ever order it wishes if you run the above code enough you will notice that the StreamWriter object is finalized before the Logger object. At this point when the Logger object is finalized it attempts to invoke it's Dispose method, which in turn attempts to invoke Dispose on StreamWriter which throws because the object has been cleaned up.</p>  <p>To fix this code I removed the Finalize method, since it should have never been implemented as we are never allocating any <strong>unmanaged</strong> resources.</p>  <p>Here are some other resources on the topic.</p>  <ul>   <li><a href="https://msdn2.microsoft.com/en-us/library/66x5fx1b.aspx">C# Destructor Syntax</a> </li>    <li><a href="https://msdn2.microsoft.com/en-us/library/fs2xkftw.aspx">Implementing a Dispose Method</a> </li> </ul>]]></content:encoded>
    </item>
    <item>
      <title>Orcas Beta 2 Automation Planning</title>
      <link>https://docs.microsoft.com/archive/blogs/eric/orcas-beta-2-automation-planning</link>
      <pubDate>Tue, 17 Apr 2007 12:44:00 GMT</pubDate>
      <dc:creator><![CDATA[Eric]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/eric/2007/04/17/orcas-beta-2-automation-planning/</guid>
      <description><![CDATA[I am in the process of finalizing the C# automation matrix for Beta 2. One of the scenarios that I...]]></description>
      <content:encoded><![CDATA[<P>I am in the process of finalizing the C# automation matrix for Beta 2. One of the scenarios that I feel receives very little coverage today,&nbsp;and that I would like some help&nbsp;with,&nbsp;is the interaction of Visual Studio with other software or machine configurations.</P>
<P>Have there been any pain points that you have run into when attempting to use Visual Studio in the past or install it that we could have made better? How is your dev box configured? Do you run as an admin or normal user? What about on Vista? Have you ever needed to install VS on a domain controller? What about a server in a DMZ that is seeing an issue that is not reproducible in the dev environment?</P>
<P>Anyway... let me know your thoughts and I'll see what I can do in order to incorporate this into our testing somehow.</P>
<P>Are there things that you would like to hear about from the C# testing/automation perspective?</P>]]></content:encoded>
    </item>
    <item>
      <title>Port 25</title>
      <link>https://docs.microsoft.com/archive/blogs/eric/port-25</link>
      <pubDate>Wed, 31 Jan 2007 12:15:00 GMT</pubDate>
      <dc:creator><![CDATA[Eric]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/eric/2007/01/31/port-25/</guid>
      <description><![CDATA[I was just walking through the hall here at MS an notice a poster with a penguin on it. The first...]]></description>
      <content:encoded><![CDATA[<P>I was just walking through the hall here at MS an notice a poster with a penguin on it. The first (and correct) thing that crossed my mind what Open Source and Linux. The poster was an advertisment for <A class="" href="https://port25.technet.com/" mce_href="https://port25.technet.com">Port 25</A>&nbsp;which is a&nbsp;community that offers a look into the Microsoft Open Source Lab.</P>
<P>&nbsp;It doesn't seem that there is a lot going on in the community site right now, but I would expect to see more coming soon. It also appears that the team and Novell are both <A class="" href="https://port25.technet.com/archive/2007/01/30/seeking-a-few-good-people-we-re-hiring-and-so-is-novell.aspx" mce_href="https://port25.technet.com/archive/2007/01/30/seeking-a-few-good-people-we-re-hiring-and-so-is-novell.aspx">hiriing</A>.</P>]]></content:encoded>
    </item>
    <item>
      <title>C# Orcas Bug Bash</title>
      <link>https://docs.microsoft.com/archive/blogs/eric/c-orcas-bug-bash</link>
      <pubDate>Thu, 25 Jan 2007 03:36:32 GMT</pubDate>
      <dc:creator><![CDATA[Eric]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/eric/2007/01/25/c-orcas-bug-bash/</guid>
      <description><![CDATA[Today at work I participated in my first bug bash after being at Microsoft for a little over 18...]]></description>
      <content:encoded><![CDATA[<p>Today at work I participated in my first bug bash after being at Microsoft for a little over 18 months. It was a lot of fun though one thing I have noticed was that due to my role in driving the automation there are a lot of things that I have become distant from in the IDE. Today was really a great time for me to sit down and really begin to digest all of the great language features that are coming in Orcas with the release of C# 3.0.</p> <p>A bug bash is a time set aside for a team (usually a product unit PU) to step back from their everyday work and spend time using the product looking for bugs. The PU will usually break those participating into smaller teams of 3 - 5 people that will then work to find bugs. Each bug found is then rated, ranked and scored. At the end of the day prizes will usually be awarded for the best bugs found and then people have bragging rights around the office for a while.</p> <p>So what has come out of our bug bash?</p> <ul> <li>There were 20 teams total that participated, 42 total individuals (PMs and SDETs from the C# team)</li> <li>As of 10:30 PM PST there had been 288 bugs logged</li> <ul> <li>Some will be resolved as by design</li> <li>Some will be duplicates</li></ul></ul>]]></content:encoded>
    </item>
    <item>
      <title>My First Review</title>
      <link>https://docs.microsoft.com/archive/blogs/eric/my-first-review</link>
      <pubDate>Fri, 15 Sep 2006 01:17:16 GMT</pubDate>
      <dc:creator><![CDATA[Eric]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/eric/2006/09/15/my-first-review/</guid>
      <description><![CDATA[Well it's that time of year at Microsoft and all employees were supposed to have the annual review...]]></description>
      <content:encoded><![CDATA[<p>Well it's that time of year at Microsoft and all employees were supposed to have the annual review completed by the end of today. I was getting a little worried there at first that I might not get my review completed in time because the C# team is pressing hard to complete all of our cool stuff for Orcas. Though my excellent manager scheduled my review this morning. I think that overall things went really well and I came out of the process with a few more things to shoot for over the next year. Well one year (actually 15 months) down and many more to come. </p>]]></content:encoded>
    </item>
    <item>
      <title>Soon To Be Recruiting</title>
      <link>https://docs.microsoft.com/archive/blogs/eric/soon-to-be-recruiting</link>
      <pubDate>Sat, 09 Sep 2006 01:23:15 GMT</pubDate>
      <dc:creator><![CDATA[Eric]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/eric/2006/09/09/soon-to-be-recruiting/</guid>
      <description><![CDATA[Today I booked my recruiting trip to Michigan Tech and the University of Chicago. It was actually...]]></description>
      <content:encoded><![CDATA[<p>Today I booked my recruiting trip to Michigan Tech and the University of Chicago. It was actually quite painful booking the trip since there are only 3 flights in and out of Houghton each day. I actually was not able to get a flight in or out of the Houghton County Airport on the days I needed so instead I am flying into Marquette, driving to Houghton, then driving down to Chicago. I am very excited about the trip and looking forward to talking with some great candidates. If you are a student at either of these schools or live near by let me know. I have some free nights and would love to grab a beer and socialize a bit.</p>]]></content:encoded>
    </item>
    <item>
      <title>C# Language Service QA Exposed</title>
      <link>https://docs.microsoft.com/archive/blogs/eric/c-language-service-qa-exposed</link>
      <pubDate>Tue, 25 Apr 2006 23:56:00 GMT</pubDate>
      <dc:creator><![CDATA[Eric]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/eric/2006/04/25/c-language-service-qa-exposed/</guid>
      <description><![CDATA[We recently had a “pep” talk on the Visual C# QA team to talk about what our mission is and what...]]></description>
      <content:encoded><![CDATA[<P>We recently had a “pep” talk on the Visual C# QA team to talk about what our mission is and what some of our goals our. The mission hasn’t been fully baked so I won’t post it the specifics about this today, but expect to see something on this very soon. </P>
<P>I did get one thing out of this discussion and it’s that we want to the individuals on this team to take pride in the excellence of testing and quality assurance. One thing I’ve noticed is that we don’t communicate very and this is a problem. </P>
<P>I’ve decided that I am going to begin trying to post about daily issues that end in success and failure. This is in part to try and learn how to communicate effectively what is going on in my team, division and inside the company as a whole. I’ll be open, honest, and would love to hear your feedback.</P>
<P>Things on the list to talk about over the next few days/weeks are:</P>
<UL>
<LI>Wrapping up <A HREF="/eric/archive/2005/11/07/489822.aspx">MQ</A></LI>
<LI><A href="https://channel9.msdn.com/ShowPost.aspx?PostID=39263&amp;section=DevDiv">MadDog</A></LI>
<LI>C# Automation (since I own that)</LI>
<LI>Orcas M1 (starting next week)</LI>
<LI>Thoughts on <A href="https://codebetter.com/blogs/scott.bellware/">Scott’s</A> <A href="https://codebetter.com/blogs/scott.bellware/archive/2006/04/25/143303.aspx">Persona Post</A></LI></UL>]]></content:encoded>
    </item>
  </channel>
</rss>