<?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>Hil's managed code development</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/hilliao/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/hilliao/feed.xml</link>
    <description>Good practices in the life of software development</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:21:02 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Android Development Ready</title>
      <link>https://docs.microsoft.com/archive/blogs/hilliao/android-development-ready</link>
      <pubDate>Thu, 14 Mar 2013 10:26:00 GMT</pubDate>
      <dc:creator><![CDATA[Hil Liao]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/hilliao/2013/03/14/android-development-ready/</guid>
      <description><![CDATA[I bought Google Nexus 4 last month and convinced 2 other female friends to buy the same model. All...]]></description>
      <content:encoded><![CDATA[<p>I bought Google Nexus 4 last month and convinced 2 other female friends to buy the same model. All of us are happy about what we got. I was fascinated with the smoothness of the user interaction and elegance of the user interface. It&rsquo;s priced at half of iPhone 5&rsquo;s retail price with a quarter larger display. No wonder Apple&rsquo;s stock tanked.</p>
<p><br />Then as a software development professional, I questioned myself: what&rsquo;s the cost of developing apps on the phone. For most Android owners with a working PC, it&rsquo;s none. For businesses, it&rsquo;s about a price of a phone and a PC. To do the same on iPhone or iOS, the price is double as Apple tends to double the prices of its products with virtually equivalent features as mainstream competitors. Google has made great <a href="https://developer.android.com/training/basics/intents/sending.html#Build">tutorial</a> and sample apps for even non software professional to easily get started with Android development.</p>
<p><br />One of the interesting problem I discovered about Android API is:<br />** Java does not have method delegates. It&rsquo;s been a known issue since .NET introduced delegate in 2003.All the Activity state transitions are done in OnCreate, OnStart, OnResume, OnPause, OnStop, OnDestroy. All the child classes are supposed to implement or override those state transitioning callback methods. A <a href="https://tw.linkedin.com/in/sleepnova">senior Android developer friend</a> informed me of such issue when he tried to develop library kind of Java code for his activities. He said it is cumbersome to have to write library&rsquo;s routine methods (initialize, close, finalize, etc&hellip;) in each On[State] callback method. I proposed a solution of using a controller to handle the mapping between activity&rsquo;s state transitioning and the library's ought-to-do routines (similar to the MVC pattern). It's not a perfect solution but does solve part of the problem. I think the root cause is that developers can't hook the code into the Activity base class for handing custom library's routines. In C#, this could have been done by assigning delegates to the state transitioning events in the Activity class. When the activity's state changes, the event triggers the assigned delegates and therefore invokes the routine methods of the custom built library.</p>
<p>Tutorial sample app's image included here. Code has been changed to show a buzzard activity state.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/10/40/23/72/activity.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-40-23-72/activity.png">activity.png</a></p>]]></content:encoded>
    </item>
    <item>
      <title>MSFT Office, SQL, Azure team interviews</title>
      <link>https://docs.microsoft.com/archive/blogs/hilliao/msft-office-sql-azure-team-interviews</link>
      <pubDate>Wed, 06 Mar 2013 21:18:00 GMT</pubDate>
      <dc:creator><![CDATA[Hil Liao]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/hilliao/2013/03/06/msft-office-sql-azure-team-interviews/</guid>
      <description><![CDATA[I decided to write a post about the interview questions forSDE 2 (level 61) positions at Microsoft....]]></description>
      <content:encoded><![CDATA[<p>I decided to write a post about the interview questions for<br />SDE 2 (level 61) positions at Microsoft. The interview experience was better<br />than what I had before. I thought I could easily get the jobs but wrong. From<br />the feedback, I think it was more a disagreement on coding practices than<br />anything else. The recruiters did not have details on which code was buggy or<br />complicated. What they received from the hiring manager was a conglomerated piece<br />of feedback. Part of the interview was confidential such as people&rsquo;s names. But<br />the questions asked were pretty much common interview questions anyone can<br />easily find on Google.</p>
<p>&nbsp;</p>
<p>SQL server team:</p>
<p>Given a string like abcdef, rotate or shift the string n<br />characters where n &lt; the length of the string without allocating a newt<br />string. Do it in-place. Hint: use multiple swapping</p>
<p>Check if a string is a palindrome in C. Change the string to<br />be Unicode 16. How do you modify the code?</p>
<p>Given a binary tree and 2 nodes in the tree, find the common<br />ancestor closest to the 2 nodes. Obviously the root is a common ancestor for<br />any 2 nodes but is the farthest from the 2 nodes.</p>
<p>Given a singly linked list, find the middle node.</p>
<p>Given a binary tree, implement breadth first search traversal<br />for each node to point to the next node. Each node will have an additional<br />pointer called next besides left, right child nodes. Hint: the data structure<br />is queue. What&rsquo;s a good implementation of queue? Answer is linked list where<br />head is the end of the queue and the last list node is the beginning of the<br />queue. Change the code to use a singly linked list for the queue. Suppose head<br />and tail nodes are given in the list.</p>
<p>Given an array of 1000 elements where each element is<br />between 1 and 1000. Duplication is allowed in the array. Implement a sorting<br />algorithm that&rsquo;s better than n log(n). Hint: what if the array has 10 elements<br />and each element is 1 or 2?</p>
<p>&nbsp;</p>
<p>Office team:</p>
<p>Given a binary tree, write a function that checks if the<br />tree is a binary search tree without using O(n) space complexity. Change the function<br />to take 2 value parameters (Min, Max).</p>
<p>Given 2 sorted arrays, merge them into 1 sorted array<br />without using O(n) space complexity. Merge in place.</p>
<p>Convert string &ldquo;2013/02/28&rdquo; to &ldquo;Thursday February 28th 2013&rdquo;.<br />Given the leap year conditions and a base day of the week for 2000/1/1, write<br />the function code to determine the day of week for any given date after 2000/1/1</p>
<p>Write a function that checks if 2 singly linked lists intersect.</p>
<p>Think of the similarity between a sorted doubly linked list and a perfect<br />or full binary search&nbsp;tree. Imagine each node in the binary tree has a parent pointer.<br />Implement the algorithm to convert the binary search tree to a sorted doubly linked list.</p>
<p>&nbsp;</p>
<p>Feedback from the teams:</p>
<p>Strengths: Good Logic, problem solving,<br />cognizant. Communication (easy to communicate). Smart, vibrant.</p>
<p>Weaknesses: Code was buggy, complicated,<br />too much time taken. They want Simple, functional code</p>
<p>&nbsp;</p>
<p>The office team recruiter told me their hiring bar was the<br />highest among all divisions at Microsoft. Both team thought my code was not as<br />pleasing to them. At that level, they expect perfect code more than value the<br />thinking process. Maybe that&rsquo;s the type of requirement for business software<br />jobs.</p>
<p>&nbsp;</p>
<p>I am adding to the blog post about Azure Fabric controller team interviews. There were 2 senior SDE and 1 SDE 2 interviewers. Here are the questions:</p>
<p>&nbsp;</p>
<p>Given 2 sorted arrays, the merge sort's algorithm combines the 2 arrays into 1 sorted array. Think of n sorted arrays. How do you combine n sorted arrays into 1 sorted array.</p>
<p>- the problem seems to be trivial. I proposed the solution of comparing the 1st element of each sorted array and pick the least element to be inserted into the big array. He said it will be O(n) time complexity just to compare. I proposed that just merge each&nbsp;2 sorted arrays from the n sorted arrays. That's how merge sort works from the smallest arrays. That seemed to strike him as if he did not expect any candidates would've thought of that. Then I asked if there is a specific angle he wants me to go for. We ended up discussing using heap to record the minimal element from the collection of the 1st elements of the n sorted arrays.</p>
<p>&nbsp;</p>
<p>Implement reader writer thread locking semantics.</p>
<p>&nbsp;</p>
<p>Same old binary tree question: implement a module in an OOD way to determine if a binary tree is a binary search tree.</p>
<p>- use interface</p>
<p>Find the largest binary search tree in a binary tree</p>
<p>- this&nbsp;tricked me off. I could only think of checking from the bottom and count the number of binary search tree nodes. Solutions are at <a href="https://www.geeksforgeeks.org/find-the-largest-subtree-in-a-tree-that-is-also-a-bst/">geeksforgeeks</a>&nbsp;and <a href="https://leetcode.com/2010/11/largest-binary-search-tree-bst-in_22.html">leetcode</a></p>
<p>Given 7 characters like in the scrabble word game, return a collection of words that use the 7 characters. E,g, a b d g&nbsp;o f f. Word "dog" and "off" use the 7 characters but "bed", "fool"&nbsp;does not.</p>
<p>What if 1 out of 7 characters is a wildcard meaning it can be any character?</p>
<p>&nbsp;</p>
<p>I managed to get feedback directly from the hiring manager without going through a recruiter. It was interesting to know all the background processing and decision making. It turned out that the hiring manager picked the top candidate who has the direct Windows Azure configuration related experience. The team is Azure fabric which is quite the core or kernel to Azure. There were 20 resumes &gt; 4 candidates &gt; 1 picked which is quite competitive. I made it to the hidden interviewer who was the principle development manager and the hiring manager's direct manager. Not bad. But still short.</p>]]></content:encoded>
    </item>
    <item>
      <title>Experiencing Windows Azure 0</title>
      <link>https://docs.microsoft.com/archive/blogs/hilliao/experiencing-windows-azure-0</link>
      <pubDate>Thu, 12 Apr 2012 22:14:23 GMT</pubDate>
      <dc:creator><![CDATA[Hil Liao]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/hilliao/2012/04/12/experiencing-windows-azure-0/</guid>
      <description><![CDATA[It&rsquo;s been a while since I looked at Windows Azure. Recently I received an employee pass to use...]]></description>
      <content:encoded><![CDATA[<p>It&rsquo;s been a while since I looked at Windows Azure. Recently I received an employee pass to use Windows Azure. I was given small computing power and storage but good enough to beat the trial version of Windows Azure. The Windows Azure Platform management portal at <a href="https://windows.azure.com/default.aspx">https://windows.azure.com/default.aspx</a> has improved to have the look and feel of a commercial website. I was able to find things I wanted usually within 1 minute the first time and 10 seconds afterwards.</p>
<p>&nbsp;</p>
<p>I started developing a WCF service which accesses SQL Azure to log temperature as a test application. Everything started with <a href="https://www.windowsazure.com/en-us/develop/net/">https://www.windowsazure.com/en-us/develop/net/</a>. You should use Visual Studio 2010 to create an Azure project. I followed the steps at <a href="https://msdn.microsoft.com/en-us/library/windowsazure/gg651130.aspx">https://msdn.microsoft.com/en-us/library/windowsazure/gg651130.aspx</a> to create my first Azure WCF project. I created a database at Azure portal and configured LINQ to SQL to dbml to the database in my Azure project. SQL Azure works smoothly with other .NET data access components with the catch that each table needs to have a primary key. Otherwise inserting data will fail.</p>
<p>&nbsp;</p>
<p>It took about 20 minutes to deploy a package to staging or upgrade a package in staging. Users would have to be patient and work on something else when deployment happens. Since it&rsquo;s a WCF service, the URL would be something like <a href="https://24351ce6f4f9449aaa7b4146dfcc1b2e.cloudapp.net/Service1.svc">https://24351ce6f4f9449aaa7b4146dfcc1b2e.cloudapp.net/Service1.svc</a>. Anyone can start a console application as a tester to consume the service. My example logs and gets the temperature to and from a database.</p>
<p>&nbsp;</p>
<p>I encountered problems when I tried installing <a href="https://www.windowsazure.com/en-us/develop/net/">https://www.windowsazure.com/en-us/develop/net/</a> on some other workstations and found strange behaviors. With Visual Studio 2010 professional and ultimate version 10.0.40219.1 SP1Rel, installation successfully detects Visual Studio and installs the correct project. The total size is ~50 MB (click on Items to be installed and scroll to the bottom to see the size). With Visual Studio ultimate version 10.0.30319.1 RTMRel, installation does not detect the existing Visual Studio and installs the Visual Studio web developer express and SQL Express plus other components which&nbsp; are ~500 MB. Upgrade to Visual Studio 2010 SP1 to avoid the problem; otherwise you will not get Azure project type when you create a new project.</p>
<p>&nbsp;</p>
<p>If you start debugging your Azure application in Visual Studio 2010 the first time, you may hit a problem of misconfigured SQL instance. Use <a href="https://msdn.microsoft.com/en-us/library/windowsazure/gg433134.aspx">https://msdn.microsoft.com/en-us/library/windowsazure/gg433134.aspx</a> as an example to change from SQLExpress instance to the default instance. My computer at home has SQL Server 2008 R2 Data Center edition which requires changing to the default instance.</p>
<p>Visual Studio</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/09/24/1300.VSAzure.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-09-24/1300.VSAzure.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/09/24/1300.VSAzure.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x768/__key/communityserver-blogs-components-weblogfiles/00-00-01-09-24/1300.VSAzure.png" /></a></p>
<p>Azure Portal</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/09/24/6170.AzurePortal.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-09-24/6170.AzurePortal.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/09/24/6170.AzurePortal.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x768/__key/communityserver-blogs-components-weblogfiles/00-00-01-09-24/6170.AzurePortal.png" /></a></p>]]></content:encoded>
    </item>
    <item>
      <title>Custom Developed Home Alarm System</title>
      <link>https://docs.microsoft.com/archive/blogs/hilliao/custom-developed-home-alarm-system</link>
      <pubDate>Wed, 21 Dec 2011 17:31:00 GMT</pubDate>
      <dc:creator><![CDATA[Hil Liao]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/hilliao/2011/12/21/custom-developed-home-alarm-system/</guid>
      <description><![CDATA[Introduction: It all started from a break in
A few weeks ago, an intruder broke into my house. My...]]></description>
      <content:encoded><![CDATA[<h2>Introduction: It all started from a break in</h2>
<p>A few weeks ago, an intruder broke into my house. My neighborhood was known for no break-ins in the past 11 years. No neighbors had break-ins since the community was built.<br />I did not activate the home alarm system or&nbsp;pay for ADT security service. Suddenly, security became an important subject in my life. Modern security systems are similar to the n-tier online service system I engineer at work. I heard that ADT&rsquo;s installation would cost more than $1000. So, I decided to build one myself.</p>
<h2>First step: iSpy with a Microsoft Lifecam</h2>
<p>I searched on the internet to find a good monitoring software system. The paid security motion detection monitoring software had impressive features but the prices were around $70 dollars. It&rsquo;s no big deal for small to medium businesses but pricy for typical families. I found a paid by service solution called iSpy. Their business model was based on using their iSpy connect website to monitor the webcam you set up at home. You need to create your login to use that service. However, if you used the iSpy Windows application, there was no charge. It allowed you to use your locally connected webcam and microphone for motion and sound detection based monitoring and recording. I configured iSpy on a PC close to my back dining room window as an application server. iSpy supported saving the recorded video in encoded .wmv files on a remote share. So, I used my Opteron workstation as the file server which had 210GB space on E drive. Based on the estimation of recording HD quality video, it would take about 1 year to fill the drive.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/09/24/2210.ispy.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-09-24/2210.ispy.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/09/24/2210.ispy.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-09-24/2210.ispy.png" /></a></p>
<h2>Adding a IP Camera</h2>
<p>Amazon and eBay sell lots of IP cameras for security monitoring. All of them seem to be built on top of the same web API using CGI (old web technology). I bought one for $60 which<br />had OK reviews. The biggest concern from the reviews was the bad translation from Chinese to English. I thought since I could read Chinese, there would be no problem. It turned out the problem was the poorly designed web interface with IE using active X. The recording UI feature was difficult to use. The UI was messy and the camera reset to the default position at least once a day, which was very bad. I searched online and found the web API to change the camera's position using HTTP GET. Since the position could be specified using the query string, I wrote a PowerShell script to rotate between 3 positions I pre-configured on the camera every 2 minutes. There was no monitoring or motion based recording features with the camera but the web API supported static image and video using 2 different HTTP URLs and basic authentication. iSpy luckily supported integrating with IP Cameras. All I had to do was to specify the IP<br />camera's IP and username/password for basic authentication. iSpy then did motion detection based recording.</p>
<p>&nbsp;</p>
<h2>Linksys and DDWRT V24 connected to Ademco 4110</h2>
<p>My friend Dr. Kleemann used DDWRT v24 firmware with customized scripts on an old Linksys WRT54G v 3.1 router to hook into the Ademco 4110 security alarm system at my house. The Ademco system's 3rd pin on the main circuit board sends a 12 volt signal when the alarm is triggered. He wrote an alarm status polling script reading one of the general purpose IO lines on the router&rsquo;s main processor, using a GPIO read command in a script on the the Linux router to poll if the IO port connected to the alarm system. To read the alarm system&rsquo;s status, users would have to telnet to the router and execute the polling script. The challenge was how to automate running the telnet command to execute the custom script, read the GPIO responses, and thereby capture the alarm status from the script output.&nbsp; The final goal was to send a text message to my phone if the alarm was triggered.&nbsp;</p>
<h2>Automating the polling of the alarm</h2>
<p>I used Send-TcpRequest.ps1 (<a href="https://www.leeholmes.com/blog/2009/10/28/scripting-network-tcp-connections-in-powershell/">https://www.leeholmes.com/blog/2009/10/28/scripting-network-tcp-connections-in-powershell/</a>)<br />to automate sending telnet commands to the router.&nbsp;To review,&nbsp;Telnet is basically sending commands over TCP to the host's port 23. It's an ancient technology with security concerns but it works great in this scenario. It took me&nbsp;some effort to figure that Send-TcpRequest.ps1 actually supports sending a string array as a series of commands to the TCP port 23. The string array<br />consisted of the login username, password, and the alarm polling script. With PowerShell, capturing the output is easy. Just assign the command to a variable and that variable has the output from the telnet session. I only wanted to check if the output contains Alarm or OK so I checked if the output contained those status strings. The PowerShell script runs in a while loop reporting the last alarm status and writes to SQL Server using sqlcmd.exe. When the alarm is triggered, it sends emails using Blat (a command line emailing tool) to multiple people who can respond to the emergency. The only problem so far is that there is no way to tell if the alarm system is armed. That is a limitation on the alarm system, and the current plan is to attempt reading Serial Data off the keypad lines to capture this status information; this work is in progress. The script for reading the alarm status, though, is complete, and available at AlarmReport.Web.zip\AlarmReport\Alarm.ps1&nbsp;</p>
<h2>SilverLight UI with asynchronous WCF and ASP.NET</h2>
<p>I had the SQL server set up for the PowerShell script to log alarm status every 7 minutes. The next<br />step was to design a UI to report the alarm status. My home Linksys router just<br />like every other router supported port forwarding. I forwarded port 8080 to my<br />IP camera, port 80 to my Opteron workstation which I used for hosting the<br />Silverlight and ASP.NET website. I wanted to create both websites so I can<br />learn more about web UI development. The solution file is at AlarmReport.Web.zip\AlarmReport\AlarmReport.sln</p>
<p>&nbsp;</p>
<h3>SilverLight 5</h3>
<p>To create the richest web experience, I had to install Visual Studio 2010 SP1 and SilverLight 5 for Visual Studio 2010 to create a SilverLight project. SilverLight uses model view-view model design pattern which separates the UI view from the business logic (method callbacks). The UI view is basically a XML file and the business logic is in C# or .NET code. What I created was a simple page with 1 DataGrid, 2 labels, 1 textbox, and 1 button. The DataGrid bound to a WCF method which returned the query data from the past 10 alarm status logs. The button and the textbox allowed user to specify the number of rows to show in the DataGrid. The other label showed the time that the last alarm had been triggered. SilverLight UI uses asynchronous WCF with event callback to populate the UI controls. So in the constructor,&nbsp;I assigned the methods that populated the DataGrid to event handlers. Using this approach, developers are compelled to<br />design a UI that's not blocking (say the WCF invocation times out, the DataGrid would be blank instead of the whole page).</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/09/24/7725.AlarmSL.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-09-24/7725.AlarmSL.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/09/24/7725.AlarmSL.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-09-24/7725.AlarmSL.png" /></a></p>
<h3>ASP.NET</h3>
<p>ASP.NET came out with .NET framework 2.0. It's an older technology and the designer in Visual Studio 2010 was hard to use. I had to manually create asynchronous WCF methods<br />when I added service references to WCF. Somehow I had to add Async="true" attribute in &lt;%@ Page on Default.aspx to use asynchronous WCF. The easy part of ASP.NET was the SqlDataSource in toolbox. It allowed me to configure the data source to the result set from a stored procedure which returned&nbsp; the last n alarm status based on a textbox's value. That was 2 birds in 1 stone. I set it up to bind the SQL data to the GridView without writing any code. If you are on a iPhone or Android, you can only access a ASP.NET website, not SilverLight. So, ASP.NET has its advantage of mobile compatibility.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/09/24/3515.AlarmASPNET.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-09-24/3515.AlarmASPNET.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/09/24/3515.AlarmASPNET.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-09-24/3515.AlarmASPNET.png" /></a></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/10/25/01/89/AlarmReport.Web.zip" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-25-01-89/AlarmReport.Web.zip">AlarmReport.Web.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Android Development Proof of Concept</title>
      <link>https://docs.microsoft.com/archive/blogs/hilliao/android-development-proof-of-concept</link>
      <pubDate>Sun, 20 Nov 2011 16:36:00 GMT</pubDate>
      <dc:creator><![CDATA[Hil Liao]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/hilliao/2011/11/20/android-development-proof-of-concept/</guid>
      <description><![CDATA[I started experiencing Android development with Eclipse and my Samsung Galaxy s 4G I rooted and...]]></description>
      <content:encoded><![CDATA[<p>I started experiencing Android development with Eclipse and my Samsung Galaxy s 4G I rooted and unlocked. It was the nicest mobile computing unit I&rsquo;ve ever bought. I thought why not write a mobile app for my phone? That&rsquo;s how I started.</p>
<p>It was not easy to set up the development in the beginning but I managed to get Samsung&rsquo;s USB driver so I can attach the debugger to the actual phone without using any virtual device. When Eclipse hit the breakpoint in a UI scenario, I was thrilled. I remember working at Windows mobile in 2006 where they had to hack Visual Studio 2005 to work with Windows mobile 6.0 and most of the applications were written in native code. Of course, things improved after .NET framework started on Windows phone but Microsoft is late on catching up on the mobile software market. Android has prevailed (over 50% market share in the US).</p>
<p>My initial idea was to write a GPS logger that would record coordinates and DateTime and upload to a Restful web service. However, there are many apps on the Android market which satisfy the same requirements. Although none of them has the flexibility of logging to a Restful web service, most of them do have the logger piece of the code done right. My goal is to familiarize myself with Android development so I thought why not just get a GPL licensed app and improve on it.</p>
<p>The app I found was <a href="https://mendhak.github.com/gpslogger/">GPS Logger</a>. Installation of Eclipse, Android SDK, Java development kit were easy. The challenging part was figuring out which Android SDK to use. If you use an old version, you can&rsquo;t take advantage of the new features of newer APIs. If you use the latest newer version, most phones can&rsquo;t install your app.</p>
<p>I started to do the work of proof of concept. I was brainstorming about how to gather the location data on the phone and persist it remotely. You can do lots of analysis and other features with data stored in a database system but not XML files on the phone. It&rsquo;d be super if Google has its version of SQL Azure but I don&rsquo;t think Google has anything similar at the moment. To get started, I just wanted to store location data on a Microsoft SQL server on my home network. It took me a while to find the <a href="https://jtds.sourceforge.net/http:/jtds.sourceforge.net/">JDBC driver</a> that fit. I wrote a SQL query that pulled some data from a table of 2 columns. That proved the phone could connect to SQL.</p>
<p>My next step is implementing a DBLogger class from the ILogger interface. I sent an email to the owner of the original project. When I get a reply, I will discuss my idea and design with the owner and get to coding.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/09/24/6471.devEnv.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-09-24/6471.devEnv.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/09/24/6471.devEnv.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-09-24/6471.devEnv.png" alt="" border="0" /></a><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/09/24/3833.JDBC.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-09-24/3833.JDBC.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/09/24/3833.JDBC.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-09-24/3833.JDBC.png" alt="" border="0" /></a></p>]]></content:encoded>
    </item>
    <item>
      <title>Count the number of combinations that add to a given sum in an int array</title>
      <link>https://docs.microsoft.com/archive/blogs/hilliao/count-the-number-of-combinations-that-add-to-a-given-sum-in-an-int-array</link>
      <pubDate>Sun, 27 Jun 2010 23:32:00 GMT</pubDate>
      <dc:creator><![CDATA[Hil Liao]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/hilliao/2010/06/27/count-the-number-of-combinations-that-add-to-a-given-sum-in-an-int-array/</guid>
      <description><![CDATA[My roommate Long Tran gave me a coding problem he found on the Internet this afternoon. I first did...]]></description>
      <content:encoded><![CDATA[<p class="MsoNormal"><span style="font-size: small;"><span style="font-family: Calibri;">My roommate Long Tran gave me a coding problem he found on the Internet this afternoon. I first did not think it was actually a coding problem but a puzzle. He gave me 2 samples of integer arrays: 5,5,10,2,3 and 1,2,3,4,5. The goal is finding the number of combinations which add up to 15. I started to break down the problem to picking 1,2,3,4,5 numbers in any combination because combination does not care about order but which element is picked. If you can find the possible combination from picking 1,2,3,4,5 numbers and count how many of them will produce 15 as the sum, you score. Everything seemed to be easy from the given 2 integer arrays. But the real problem comes to arbitrary array and a given sum. What if I want you to code such a program that takes an integer array and a number as sum and produces the count of combinations of picked elements which add up to the given sum?</span></span></p>
<p><br /></p>
<p class="MsoNormal"><span style="font-family: Calibri; font-size: small;">I started to think if 2 elements are picked, pick the 1st from any element and pick the 2nd from any element after the 1st element would exhaust all combinations of picking 2 elements. The same rule applies to picking n elements. I knew if I focused on solving picking 2 elements and get the count, I&rsquo;d be half way there. To pick the 1st element, I need a for loop to pick any element. To pick the 2nd element, I need a recursive function (</span><span style="FONT-FAMILY: Consolas; COLOR: #00b050; FONT-SIZE: 9.5pt">CountSum</span><span style="font-family: Calibri; font-size: small;">) that starts from the next element (</span><span style="FONT-FAMILY: Consolas; COLOR: #00b050; FONT-SIZE: 9.5pt">StartIndex</span><span style="font-family: Calibri; font-size: small;">) of the 1st element to the last, which will be the same for loop but the starting index will be 1 ahead. This is only 1/3 of the problem. To solve picking n element instead of 2, the concept of depth (</span><span style="FONT-FAMILY: Consolas; COLOR: #00b050; FONT-SIZE: 9.5pt">DepthLeft</span><span style="font-size: small;"><span style="font-family: Calibri;">) needs to be introduced. Depth means how many recursions are needed. In the case of picking 2 elements, 2 recursions are needed. Each recursion counts as 1 invocation of the function.</span></span></p>
<p><br /></p>
<p class="MsoNormal"><span style="font-family: Calibri; font-size: small;">How do I record the sum from the previous recursion? If I pick 2 elements, the 2nd recursion needs to know which element in the previous was added to the sum. The function needs to pass the accumulated sum (</span><span style="FONT-FAMILY: Consolas; COLOR: #00b050; FONT-SIZE: 9.5pt">AccumulatedSum</span><span style="font-family: Calibri; font-size: small;">) from past recursions. At the recursive call, add the chosen element and the previous sum as the (</span><span style="FONT-FAMILY: Consolas; COLOR: #00b050; FONT-SIZE: 9.5pt">AccumulatedSum</span><span style="font-family: Calibri; font-size: small;">) parameter. Remember to set (</span><span style="FONT-FAMILY: Consolas; COLOR: #00b050; FONT-SIZE: 9.5pt">StartIndex</span><span style="font-family: Calibri; font-size: small;">) to the chosen index + 1 and decrement (</span><span style="FONT-FAMILY: Consolas; COLOR: #00b050; FONT-SIZE: 9.5pt">DepthLeft</span><span style="font-size: small;"><span style="font-family: Calibri;">).</span></span></p>
<p><br /></p>
<p class="MsoNormal"><o:p><span style="font-family: Calibri; font-size: small;"></span></o:p></p>
<p class="MsoNormal"><span style="font-family: Calibri; font-size: small;">The base case of the recursive function is when (</span><span style="FONT-FAMILY: Consolas; COLOR: #00b050; FONT-SIZE: 9.5pt">DepthLeft</span><span style="font-family: Calibri; font-size: small;">) is 0 meaning there is no more element to pick. In that case, the function must return. Before returning, check if (</span><span style="FONT-FAMILY: Consolas; COLOR: #00b050; FONT-SIZE: 9.5pt">AccumulatedSum</span><span style="font-family: Calibri; font-size: small;">) is equal to the given sum. If yes, increment the counter. Now, you have the recursive function complete. In the main function, iterate through the array on (</span><span style="FONT-FAMILY: Consolas; COLOR: #00b050; FONT-SIZE: 9.5pt">DepthLeft</span><span style="font-family: Calibri; font-size: small;">) from 1 to the array&rsquo;s length with (</span><span style="FONT-FAMILY: Consolas; COLOR: #00b050; FONT-SIZE: 9.5pt">StartIndex</span><span style="font-family: Calibri; font-size: small;">) and (</span><span style="FONT-FAMILY: Consolas; COLOR: #00b050; FONT-SIZE: 9.5pt">AccumulatedSum</span><span style="font-family: Calibri; font-size: small;">) set to 0. The attached Visual Studio 2010 solution takes &ldquo;</span><span style="FONT-FAMILY: Consolas; COLOR: blue; FONT-SIZE: 9.5pt">InputArrayFile</span><span style="font-family: Calibri; font-size: small;">&rdquo; and generates &ldquo;</span><span style="FONT-FAMILY: Consolas; COLOR: blue; FONT-SIZE: 9.5pt">OutputResumeFile</span><span style="font-size: small;"><span style="font-family: Calibri;">&rdquo; with the count.<o:p></o:p></span></span></p>
<p><br /></p>
<p class="MsoNormal"><span style="font-size: small;"><span style="font-family: Calibri;">Another side question is how do you record the combinations which add to the given sum? If I say, not only give the count but tell me those combinations that add up to the given sum. Can you improve the code to do that?<o:p></o:p></span></span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/10/03/13/75/ArrayCountSum.zip" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-03-13-75/ArrayCountSum.zip">ArrayCountSum.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Visual Studio 2010 x64 code coverage</title>
      <link>https://docs.microsoft.com/archive/blogs/hilliao/visual-studio-2010-x64-code-coverage</link>
      <pubDate>Thu, 17 Jun 2010 20:01:00 GMT</pubDate>
      <dc:creator><![CDATA[Hil Liao]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/hilliao/2010/06/17/visual-studio-2010-x64-code-coverage/</guid>
      <description><![CDATA[The internal code coverage tool I was talking about in my previous post has been shipped with Visual...]]></description>
      <content:encoded><![CDATA[<p>The internal code coverage tool I was talking about in <a href="https://blogs.msdn.com/b/hilliao/archive/2008/08/19/code-coverage-using-visual-studio-2008-s-code-coverage-tools.aspx">my previous post</a> has been shipped with Visual Studio 2010. The full path to it is <span style="text-decoration: underline;">\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Performance Tools\x64<span style="color: #008000;"></span></span> for the 64 bit code coverage. 1 layer up the folder is for the x86 code coverage. The commands are the same as in <a href="https://blogs.msdn.com/b/hilliao/archive/2008/08/19/code-coverage-using-visual-studio-2008-s-code-coverage-tools.aspx">my previous post</a> but you need to install the highlighted component to get the <span style="color: #008000;">x64</span> folder to appear.</p>
<p><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/09/24/6180.vsinstall.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/640x0/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-09-24/6180.vsinstall.png" border="0" /></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Reference: <a href="https://msdn.microsoft.com/en-us/library/ms182403.aspx">VsPerfCmd</a></p>
<p>Steps of how to collect code coverage data of WCF and Windows Service</p>
<p class="MsoListParagraphCxSpFirst"><span style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri; font-size: small;">1.</span><span style="font: 7pt 'Times New Roman';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-size: small;"><span style="font-family: Calibri;">Stop all the services or processes of instrumented binary files (e,g, WstJobFrameworkAgent, WstJobFrameworkManager service)<o:p></o:p></span></span></p>
<p class="MsoListParagraphCxSpLast"><span style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri; font-size: small;">2.</span><span style="font: 7pt 'Times New Roman';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-size: small;"><span style="font-family: Calibri;">Run <span style="color: #002060;">the command </span>to start code coverage monitor. Change C:\183.coverage to a different filename for the to be saved code coverage file.<o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;">C:\Users\hiliao&gt; </span><span style="font-family: Consolas; color: #002060; font-size: 9.5pt;">"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Performance Tools\x64\VSPerfCmd.exe" /start:coverage /output:C:\<b style="mso-bidi-font-weight: normal;">183</b>.coverage /cs /user:Everyone</span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; font-size: 9.5pt;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;">Microsoft (R) VSPerf Command Version 10.0.30319 x64<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;">Copyright (C) Microsoft Corp. All rights reserved.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoListParagraphCxSpFirst"><span style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri; font-size: small;">3.</span><span style="font: 7pt 'Times New Roman';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-size: small;"><span style="font-family: Calibri;">Start the service stopped at step 1. Run BVT test. BVT starts hitting WCF and consuming the services<o:p></o:p></span></span></p>
<p class="MsoListParagraphCxSpLast"><span style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri; font-size: small;">4.</span><span style="font: 7pt 'Times New Roman';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-size: small;"><span style="font-family: Calibri;">Run <span style="color: #002060;">the command </span>to check if code coverage is running<o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; font-size: 9.5pt;">C:\Users\hiliao&gt; <span style="color: #002060;">"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\</span></span><span style="font-family: Consolas; color: #002060; font-size: 9.5pt;">Performance Tools\x64\VSPerfCmd.exe" /status<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;">Microsoft (R) VSPerf Command Version 10.0.30319 x64<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;">Copyright (C) Microsoft Corp. All rights reserved.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;">Process and Thread Status<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;">============================================================<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;">Output File Name<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>: C:\183.coverage<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;">Collection mode<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>: COVERAGE<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;">Maximum Processes<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>: 64<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;">Maximum Threads<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>: 512<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;">Number of Buffers<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>: 514<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;">Size of Buffers<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>: 65536<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;">============================================================<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;">Maximum Number of Processes : 64<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;">Number of Active Processes<span style="mso-spacerun: yes;">&nbsp; </span>: 3<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;">Global Start/Stop Count<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp; </span>: 1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;">Global Suspend/Resume Count : 0<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;">------------------------------------------------------------<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;"><span style="mso-spacerun: yes;">&nbsp;</span>Process<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>:<span style="mso-spacerun: yes;">&nbsp; </span><span style="background: aqua; mso-highlight: aqua;">D:\Program Files\Microsoft Webstore\WstJobFrameworkAgent.exe</span><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;"><span style="mso-spacerun: yes;">&nbsp;</span>Process ID<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>: 6288<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;"><span style="mso-spacerun: yes;">&nbsp;</span>Num Threads<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>: 0<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;"><span style="mso-spacerun: yes;">&nbsp;</span>Start/Stop Count<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>: 1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;"><span style="mso-spacerun: yes;">&nbsp;</span>Suspend/Resume Count<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>: 0<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;">------------------------------------------------------------<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;"><span style="mso-spacerun: yes;">&nbsp;</span>Process<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>:<span style="mso-spacerun: yes;">&nbsp; </span><span style="background: aqua; mso-highlight: aqua;">c:\windows\system32\inetsrv\w3wp.exe</span><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;"><span style="mso-spacerun: yes;">&nbsp;</span>Process ID<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>: 6592<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;"><span style="mso-spacerun: yes;">&nbsp;</span>Num Threads<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>: 0<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;"><span style="mso-spacerun: yes;">&nbsp;</span>Start/Stop Count<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>: 1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;"><span style="mso-spacerun: yes;">&nbsp;</span>Suspend/Resume Count<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>: 0<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;">------------------------------------------------------------<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;"><span style="mso-spacerun: yes;">&nbsp;</span>Process<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>:<span style="mso-spacerun: yes;">&nbsp; </span><span style="background: aqua; mso-highlight: aqua;">c:\windows\system32\inetsrv\w3wp.exe</span><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;"><span style="mso-spacerun: yes;">&nbsp;</span>Process ID<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>: 4252<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;"><span style="mso-spacerun: yes;">&nbsp;</span>Num Threads<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>: 0<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;"><span style="mso-spacerun: yes;">&nbsp;</span>Start/Stop Count<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>: 1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;"><span style="mso-spacerun: yes;">&nbsp;</span>Suspend/Resume Count<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>: 0<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;">============================================================<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;">Users with access rights to monitor:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;">UserName (SID)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;">\Everyone (S-1-1-0)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;">BUILTIN\Administrators (S-1-5-32-544)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;">NT AUTHORITY\SYSTEM (S-1-5-18)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Consolas; font-size: 9.5pt;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoListParagraphCxSpFirst"><span style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri; font-size: small;">5.</span><span style="font: 7pt 'Times New Roman';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-size: small;"><span style="font-family: Calibri;">Look for the <span style="background: aqua; mso-highlight: aqua;">turquoise color</span> indicating that BVT is hitting the WCF and webstore service<o:p></o:p></span></span></p>
<p class="MsoListParagraphCxSpMiddle"><span style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri; font-size: small;">6.</span><span style="font: 7pt 'Times New Roman';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-size: small;"><span style="font-family: Calibri;">Wait for the BVT test to complete<o:p></o:p></span></span></p>
<p class="MsoListParagraphCxSpMiddle"><span style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri; font-size: small;">7.</span><span style="font: 7pt 'Times New Roman';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-size: small;"><span style="font-family: Calibri;">Stop the services and processes started before. In case of WCF, stop IIS.<o:p></o:p></span></span></p>
<p class="MsoListParagraphCxSpMiddle"><span style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri; font-size: small;">8.</span><span style="font: 7pt 'Times New Roman';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-size: small;"><span style="font-family: Calibri;">Run <span style="color: #002060;">the command </span>to shut down the code coverage monitor. If you did not stop the service or process, you will see the following waiting messages.<o:p></o:p></span></span></p>
<p class="MsoListParagraphCxSpMiddle"><span style="line-height: 115%; font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;">C:\Users\hiliao&gt; </span><span style="line-height: 115%; font-family: Consolas; color: #002060; font-size: 9.5pt;">"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle"><span style="line-height: 115%; font-family: Consolas; color: #002060; font-size: 9.5pt;">Performance Tools\x64\VSPerfCmd.exe" /shutdown</span><span style="line-height: 115%; font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;"><o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle"><span style="line-height: 115%; font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;">Microsoft (R) VSPerf Command Version 10.0.30319 x64<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle"><span style="line-height: 115%; font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;">Copyright (C) Microsoft Corp. All rights reserved.<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle"><span style="line-height: 115%; font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoListParagraphCxSpMiddle"><span style="line-height: 115%; font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoListParagraphCxSpMiddle"><span style="line-height: 115%; font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;">Waiting for process 4420 ( D:\Program Files\Microsoft Webstore\WstJobFrameworkAg<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle"><span style="line-height: 115%; font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;">ent.exe) to shutdown...<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle"><span style="line-height: 115%; font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;">Waiting for process 6592 ( c:\windows\system32\inetsrv\w3wp.exe) to shutdown...<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle"><span style="line-height: 115%; font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;">Shutting down the Profile Monitor<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle"><span style="line-height: 115%; font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;">------------------------------------------------------------<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle"><span style="line-height: 115%; font-family: Consolas; color: #4a452a; font-size: 9.5pt; mso-themecolor: background2; mso-themeshade: 64; mso-style-textfill-fill-color: #4A452A; mso-style-textfill-fill-themecolor: background2; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-colortransforms: lumm=25000;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoListParagraphCxSpMiddle"><span style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri; font-size: small;">9.</span><span style="font: 7pt 'Times New Roman';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-family: Calibri; font-size: small;">Refer to </span><span style="line-height: 115%; font-family: Consolas; color: #002060; font-size: 9.5pt;">C:\<b style="mso-bidi-font-weight: normal;">183</b>.coverage</span><span style="font-size: small;"><span style="font-family: Calibri;"> for the code coverage result.<o:p></o:p></span></span></p>
<p class="MsoListParagraphCxSpMiddle"><span style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri; font-size: small;">10.</span><span style="font: 7pt 'Times New Roman';">&nbsp;&nbsp; </span></span></span><span style="font-size: small;"><span style="font-family: Calibri;">If you see error message like that when you open the .coverage file in Visual Studio 2010, that means you are missing the original instrumented binary files.<o:p></o:p></span></span></p>
<p class="MsoListParagraphCxSpMiddle"><span style="mso-no-proof: yes;"><v:shapetype coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f" id="_x0000_t75"><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"></v:path><o:lock v:ext="edit" aspectratio="t"></o:lock></v:shapetype></span><o:p></o:p></p>
<p class="MsoListParagraphCxSpMiddle"><span style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri; font-size: small;"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/09/24/6472.CCError.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-09-24/6472.CCError.png" border="0" /></span></span></span></p>
<p class="MsoListParagraphCxSpMiddle"><span style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri; font-size: small;">11.</span><span style="font: 7pt 'Times New Roman';">&nbsp;&nbsp; </span></span></span><span style="font-size: small;"><span style="font-family: Calibri;">Copy the missing files from the machine where you ran vsinstr.exe to the exact same folder location. Close the code coverage result by click on the X [remove] button. Re-open the .coverage file to get the following result.<o:p></o:p></span></span></p>
<p class="MsoListParagraphCxSpLast"><span style="mso-no-proof: yes;"></span><o:p></o:p></p>
<p><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/09/24/7633.CCResult.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/640x0/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-09-24/7633.CCResult.png" border="0" />&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>UIAutomationClient</title>
      <link>https://docs.microsoft.com/archive/blogs/hilliao/uiautomationclient</link>
      <pubDate>Thu, 17 Jun 2010 19:37:00 GMT</pubDate>
      <dc:creator><![CDATA[Hil Liao]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/hilliao/2010/06/17/uiautomationclient/</guid>
      <description><![CDATA[In the other blog about UI automation, I forgot to mention how to add the reference and should have...]]></description>
      <content:encoded><![CDATA[<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="line-height: 115%; font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;">In the </span><a href="https://blogs.msdn.com/b/hilliao/archive/2008/08/20/system-windows-automation.aspx"><span style="line-height: 115%; font-family: 'Arial','sans-serif'; font-size: 9pt;">other blog</span></a><span style="line-height: 115%; font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"> about UI automation, I forgot to mention how to add the reference and should have included the solution. The assembly to reference is called UIAutomationClient in Visual Studio 2010. Use </span><a href="https://msdn.microsoft.com/en-us/library/ms726294(VS.85).aspx"><span style="line-height: 115%; font-family: 'Arial','sans-serif'; font-size: 9pt;">this MSDN article</span></a><span style="line-height: 115%; font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"> and </span><a href="https://msdn.microsoft.com/en-us/magazine/cc163288.aspx"><span style="line-height: 115%; font-family: 'Arial','sans-serif'; font-size: 9pt;">James McCaffrey's blog</span></a><span style="line-height: 115%; font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"> to get started. I am attaching my sample solution here but the Windows form application it's testing is missing. However, the code itself and the comments in the code should give you enough idea on how to write your unit tests of the Windows form application. The picture below shows the assembly reference to get started.</span></p>
<p><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/09/24/4745.UIAuto.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-09-24/4745.UIAuto.png" border="0" /></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/10/02/68/13/MDSWebServiceClientTest.zip" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-02-68-13/MDSWebServiceClientTest.zip">MDSWebServiceClientTest.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Load Code Coverage Data to SQL database</title>
      <link>https://docs.microsoft.com/archive/blogs/hilliao/load-code-coverage-data-to-sql-database</link>
      <pubDate>Fri, 03 Oct 2008 17:19:00 GMT</pubDate>
      <dc:creator><![CDATA[Hil Liao]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/hilliao/2008/10/03/load-code-coverage-data-to-sql-database/</guid>
      <description><![CDATA[Load Code Coverage Data to SQL database
Use Visual Studio’s code coverage tools to obtain the...]]></description>
      <content:encoded><![CDATA[<H2 style="MARGIN: 10pt 0in 0pt"><FONT face=Cambria color=#4f81bd size=4>Load Code Coverage Data to SQL database</FONT></H2>
<H3 style="MARGIN: 10pt 0in 0pt"><FONT face=Cambria color=#4f81bd size=3>Use Visual Studio’s code coverage tools to obtain the .coverage file</FONT></H3>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>Visual Studio has a set of tools that can collect your code coverage data. The data structure of the collected code coverage data is in a </FONT><A href="https://msdn.microsoft.com/en-us/library/cc667391.aspx" mce_href="https://msdn.microsoft.com/en-us/library/cc667391.aspx"><FONT face=Calibri size=3>table format</FONT></A><FONT face=Calibri size=3>. As you can see from the link, it shows how to obtain code coverage data, which is not what I am covering here. This article is talking about how to load the .coverage file into a SQL server database. You can refer to my </FONT><A href="https://blogs.msdn.com/hilliao/archive/2008/08/19/code-coverage-using-visual-studio-2008-s-code-coverage-tools.aspx" mce_href="https://blogs.msdn.com/hilliao/archive/2008/08/19/code-coverage-using-visual-studio-2008-s-code-coverage-tools.aspx"><FONT face=Calibri size=3>previous blog</FONT></A><FONT face=Calibri size=3> about how to obtain x64 code coverage data. The result of the code coverage data is a .coverage file. Open it in Visual Studio 2008 Code Coverage Results panel (see attachments). When you expand the first + sign, Visual Studio reads the .pdb and binary files from where you originally executed the code coverage profiler. For example, suppose you collected code coverage data on a remote server and copied the .coverage file to your local machine. When you click on the + sign of the .coverage file, you will get “Code Coverage Analysis engine threw exception(s): Error when creating coverage info: Error loading symbol file. Symbol and binary files should be in the same folder as the coverage file or on the symbol path”. The solution is copy the symbol (.pdb) files and the binary from the remote server to your local machine at the same path. Click on Export Results button in the panel to save to a .xml file. We will cover how to use the xml file in the later section.</FONT></P>
<H3 style="MARGIN: 10pt 0in 0pt"><FONT face=Cambria color=#4f81bd size=3>Use code coverage API to retrieve code coverage data</FONT></H3>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><FONT face=Calibri size=3>The code coverage API is not documented. The closest thing you can get is </FONT><A href="https://blogs.msdn.com/ms_joc/articles/495996.aspx" mce_href="https://blogs.msdn.com/ms_joc/articles/495996.aspx"><FONT face=Calibri size=3>joc's bLog</FONT></A><FONT face=Calibri size=3>. You could find the code coverage assembly at \Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.Coverage.Analysis.dll. If you run in x64 Windows, make sure you configure your project properties to Platform Target: x86. Otherwise, you will get {"Could not load file or assembly 'Microsoft.VisualStudio.Coverage.Analysis, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. An attempt was made to load a program with an incorrect format."} exception. Microsoft.VisualStudio.Coverage.Analysis.dll is a 32 bit dll. </FONT><A href="https://blogs.msdn.com/ms_joc/articles/495996.aspx" mce_href="https://blogs.msdn.com/ms_joc/articles/495996.aspx"><FONT face=Calibri size=3>joc's bLog</FONT></A><FONT face=Calibri size=3> shows how to use a query to filter what methods you want for method code coverage data:<BR></FONT><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">using</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> Microsoft.VisualStudio.CodeCoverage;<SPAN style="COLOR: #2b91af"><BR>CoverageDSPriv</SPAN>.<SPAN style="COLOR: #2b91af">MethodDataTable</SPAN> methodDT = myCovDS.Method;<BR><SPAN style="COLOR: #2b91af">DataRow</SPAN>[] methodDR = methodDT.Select(<SPAN style="COLOR: #a31515">"MethodName IN "</SPAN> + searchmethods);<BR></SPAN><FONT face=Calibri size=3>Above is the code breakdown. You can use “</FONT><SPAN style="FONT-SIZE: 10pt; COLOR: #2b91af; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">SqlBulkCopy</SPAN><FONT face=Calibri size=3>” class to load “</FONT><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">methodDT</SPAN><FONT face=Calibri size=3>” to a SQL server table. You need to have the same column name in the table on the SQL server as those in “</FONT><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">methodDT</SPAN><FONT face=Calibri size=3>”. Below is the code that uses “</FONT><SPAN style="FONT-SIZE: 10pt; COLOR: #2b91af; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">SqlBulkCopy</SPAN><FONT face=Calibri size=3>” class to import the code coverage data:<BR></FONT><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">using</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> (<SPAN style="COLOR: #2b91af">SqlBulkCopy</SPAN> SqlBCP = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">SqlBulkCopy</SPAN>(connString))<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>SqlBCP.DestinationTableName = <SPAN style="COLOR: #a31515">"Method"</SPAN>;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>SqlBCP.WriteToServer(methodDT);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">}<o:p></o:p></SPAN></P>
<H3 style="MARGIN: 10pt 0in 0pt"><FONT face=Cambria color=#4f81bd size=3>Use SQL Server Integration Service project to create code coverage data tables</FONT></H3>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>“</FONT><SPAN style="FONT-SIZE: 10pt; COLOR: #2b91af; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">SqlBulkCopy</SPAN><FONT face=Calibri size=3>” class does not create the table structure for you. You need to create it manually. Although it’s only 8-9 columns depending on the </FONT><SPAN style="FONT-SIZE: 10pt; COLOR: #2b91af; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">CoverageDSPriv</SPAN><FONT face=Calibri size=3>’s DataTable structure, there is actually a smarter way to create the table by using a SSIS (SQL server integration service) project through SQL Server Business Intelligence Development Studio. Make sure you have the following features installed in your SQL Server 2008: Business Intelligence Development Studio and Integration Services. Integration Services can run under Network Service account. Open Visual Studio 2008. Click on File &gt; New &gt; Project… Find Project types Business Intelligence Projects &gt; Integration Services Project. Open the SSIS Packages &gt; Package.dtsx, go to the Data Flow tab. Click to add a data flow task. Open Toolbox. Drop and drop XML Source into the designer surface. Double click on the XML source. Locate the XML file generated from the Code Coverage Results panel’s export results. Check “Use inline schema” and hit OK. Choose OK to accept the warnings. Drag and drop an OLE DB Destination to the designer surface. Highlight the XML source and point the green arrow to the OLE DB Destination. Select Output as what kind of </FONT><SPAN style="FONT-SIZE: 10pt; COLOR: #2b91af; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">CoverageDSPriv</SPAN><FONT face=Calibri size=3>’s DataTable you want. For example, you can choose Class and hit OK. Double click on the OLE DB Destination. Click on New… at “OLE DB connection manager” to create a new connection to the database you want to load code coverage data to. Click on New at “Name of the table or the view” to see the SQL query that will create the table. Change the table name and hit OK. The table is now created. The OK button in the editor is disabled. Click on Mappings on the left pane and make sure the Input columns in </FONT><SPAN style="FONT-SIZE: 10pt; COLOR: #2b91af; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">CoverageDSPriv</SPAN><FONT face=Calibri size=3>’s DataTable correctly map to the destination columns. Now, you can hit OK in the editor. Add more OLE DB Destination to the designer surface and link the XML source to it with different Output. If you see any error in the Error List, try to resolve them by double clicking on them to analyze. Removing incorrectly mapped references might help. When you see no errors, save the .dtsx file and open it in Execute Package Utility by double clicking on it. This should guide you through loading data to the SQL server. At this point, I always get errors when loading method coverage data to the database. There seems to be a truncation error. You might have to load it row by row in ADO.NET or LINQ by following the code sample in the previous section.</FONT></P>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/08/97/59/28/CodeCoveragePanel.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-08-97-59-28/CodeCoveragePanel.png">CodeCoveragePanel.png</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Test .NET library using PowerShell and Visual Studio Debugger</title>
      <link>https://docs.microsoft.com/archive/blogs/hilliao/test-net-library-using-powershell-and-visual-studio-debugger</link>
      <pubDate>Mon, 15 Sep 2008 18:58:00 GMT</pubDate>
      <dc:creator><![CDATA[Hil Liao]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/hilliao/2008/09/15/test-net-library-using-powershell-and-visual-studio-debugger/</guid>
      <description><![CDATA[Often times, when a developer builds a C# library, there is always a need for unit testing it. If...]]></description>
      <content:encoded><![CDATA[<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>Often times, when a developer builds a C# library, there is always a need for unit testing it. If your company already has strictly guidelines on how to enforce unit testing before any code is checked in, you might want to read the policy procedure about how to do it. Visual Studio Team System 2008 can be configured to enforce such policy that if any unit tests fail, the check in is rejected. You can right click on the solution-&gt;New-&gt;Add project-&gt;Test-&gt;Test project to create unit tests. Every time, you change the data in your test, you need to re-compile the test dll and run the test. Don’t you think that’s an overhead for changing calls from ”</FONT><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">client.CreateEmail(<SPAN style="COLOR: #a31515">"XBOX"</SPAN>, <SPAN style="COLOR: #a31515">"hil1@msn.com"</SPAN>);</SPAN><FONT face=Calibri size=3>” to “</FONT><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">client.CreateEmail(<SPAN style="COLOR: #a31515">"Live"</SPAN>, <SPAN style="COLOR: #a31515">"hil1@msn.com"</SPAN>);</SPAN><FONT face=Calibri size=3>”? PowerShell comes handy to solve this problem. You can easily code unit tests for your methods and change them without re-compiling. Here is how:</FONT></P>
<P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"><SPAN style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT face=Calibri size=3>1.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT face=Calibri size=3>Install </FONT><A href="https://www.microsoft.com/powershell" mce_href="https://www.microsoft.com/powershell"><FONT face=Calibri color=#0000ff size=3>Windows PoweShell</FONT></A></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"><SPAN style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT face=Calibri size=3>2.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT face=Calibri size=3>Open a PowerShell window, type powershell and hit enter. Notice there are 2 powershell.exe processes running. One is the parent and the other is the child. You are in the child process. Use </FONT><A href="https://technet.microsoft.com/en-us/sysinternals/bb896653.aspx" mce_href="https://technet.microsoft.com/en-us/sysinternals/bb896653.aspx"><FONT face=Calibri size=3>process explorer</FONT></A><FONT face=Calibri size=3> to observe the 2 processes and write down the child process ID.</FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"><SPAN style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT face=Calibri size=3>3.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT face=Calibri size=3>Build the .NET library solution. The .dll should reside in bin\Debug folder.</FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"><SPAN style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT face=Calibri size=3>4.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT face=Calibri size=3>At powershell prompt, run PS &gt; $loadResult = </FONT><A href="https://msdn.microsoft.com/en-us/library/system.reflection.assembly.loadfrom.aspx" mce_href="https://msdn.microsoft.com/en-us/library/system.reflection.assembly.loadfrom.aspx"><FONT face=Calibri size=3>[Reflection.Assembly]::LoadFrom</FONT></A><FONT face=Calibri size=3>("D:\product\src\test\DataAccess\bin\Debug\Microsoft.IT.Product.Library.dll"). All the dll files referenced by Microsoft.IT.Product.Library.dll will also be loaded. Be aware that if you use </FONT><A href="https://msdn.microsoft.com/en-us/library/system.reflection.assembly.loadfile.aspx" mce_href="https://msdn.microsoft.com/en-us/library/system.reflection.assembly.loadfile.aspx"><FONT face=Calibri size=3>[Reflection.Assembly]::LoadFile</FONT></A><FONT face=Calibri size=3>, the referenced dll files will NOT be loaded.</FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"><SPAN style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT face=Calibri size=3>5.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT face=Calibri size=3>If you see no errors and $loadResult shows no errors, you are probably fine.</FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"><SPAN style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT face=Calibri size=3>6.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT face=Calibri size=3>Command to instantiate your <SPAN style="BACKGROUND: yellow; mso-highlight: yellow">class</SPAN>: PS &gt; $verify = New-Object Microsoft.IT.Product.Library.<SPAN style="BACKGROUND: yellow; mso-highlight: yellow">VerifyData</SPAN>("Data Source=.;Initial Catalog=EmailStore;Integrated Security=True"). Notice that <SPAN style="BACKGROUND: yellow; mso-highlight: yellow">VerifyData</SPAN> is the class name which takes a constructor of 1 string argument.</FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"><SPAN style="COLOR: red; mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT face=Calibri size=3><SPAN style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT face=Calibri color=#000000 size=3>7.</FONT></SPAN></SPAN></FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3><FONT face=Calibri>Run a unit test on a method: PS &gt; $verify.EmailExists("testuser@msn.com"). If the constructor throws an exception, you will see the following:<BR><SPAN style="COLOR: red">New-Object : Exception calling ".ctor" with "1" argument(s): "Database EmailStore does not exist"<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></FONT></FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><SPAN style="COLOR: red"><FONT size=3><FONT face=Calibri>At line:1 char:21<o:p></o:p></FONT></FONT></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><SPAN style="COLOR: red"><FONT size=3><FONT face=Calibri>+ $verify = New-Object<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>&lt;&lt;&lt;&lt; Microsoft.IT.Product.Library.VerifyData("Data Source=.;Initial Catalog=EmailStore;Integrated Security=True")<o:p></o:p></FONT></FONT></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"><SPAN style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT face=Calibri size=3>8.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT face=Calibri size=3>In Visual Studio 2008, click on Debug-&gt;Attach to Process… You should be able to see 2 PowerShell processes. Choose the child process. Remember you call </FONT><A href="https://msdn.microsoft.com/en-us/library/system.reflection.assembly.loadfrom.aspx" mce_href="https://msdn.microsoft.com/en-us/library/system.reflection.assembly.loadfrom.aspx"><FONT face=Calibri size=3>[Reflection.Assembly]::LoadFrom</FONT></A><FONT face=Calibri size=3> in the child powershell process.</FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"><SPAN style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT face=Calibri size=3>9.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT face=Calibri size=3>After successfully attached to the correct process, you should be able to set break points at anywhere within your library. If the break point says “No symbols have been loaded for this document”, you probably have attached to the wrong powershell process.</FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"><SPAN style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT face=Calibri size=3>10.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT face=Calibri size=3>You can use PowerShell to run all the methods in your library to unit test them in Visual Studio. When you are done testing, unfortunately, you can’t unload the assembly. You need to exit the Child PowerShell to unload the assembly. Otherwise, you will get error when building the solution: Unable to delete file. That is because the child PowerShell process is still holding the loaded assembly. Simply type exit at the child PowerShell prompt to unload it.</FONT></P>
<P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"><SPAN style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT face=Calibri size=3>11.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT face=Calibri size=3>To test static <SPAN style="BACKGROUND: yellow; mso-highlight: yellow">method</SPAN> in the library, use [Microsoft.IT.Product.Library.VerifyData]::<SPAN style="BACKGROUND: yellow; mso-highlight: yellow">RandomString</SPAN>(4). <SPAN style="BACKGROUND: yellow; mso-highlight: yellow">RandomString</SPAN> is a static method that takes 1 int argument.</FONT></P>]]></content:encoded>
    </item>
  </channel>
</rss>