<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>dotnet thoughts</title>
	<atom:link href="http://www.dotnetthoughts.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dotnetthoughts.net</link>
	<description>a dotnet developer&#039;s technical blog</description>
	<lastBuildDate>Thu, 02 Feb 2012 03:18:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail</title>
		<link>http://www.dotnetthoughts.net/2012/02/01/the-application-has-failed-to-start-because-its-side-by-side-configuration-is-incorrect-please-see-the-application-event-log-or-use-the-command-line-sxstrace-exe-tool-for-more-detail/</link>
		<comments>http://www.dotnetthoughts.net/2012/02/01/the-application-has-failed-to-start-because-its-side-by-side-configuration-is-incorrect-please-see-the-application-event-log-or-use-the-command-line-sxstrace-exe-tool-for-more-detail/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 03:18:00 +0000</pubDate>
		<dc:creator>Anuraj P</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[.Net 3.0 / 3.5]]></category>
		<category><![CDATA[.Net 4.0]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[sxstrace]]></category>
		<category><![CDATA[sxstrace.exe]]></category>

		<guid isPermaLink="false">http://www.dotnetthoughts.net/?p=2332</guid>
		<description><![CDATA[Today I got a comment from Vitor, Vitor is getting an exception like this while starting application. The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe &#8230; <a href="http://www.dotnetthoughts.net/2012/02/01/the-application-has-failed-to-start-because-its-side-by-side-configuration-is-incorrect-please-see-the-application-event-log-or-use-the-command-line-sxstrace-exe-tool-for-more-detail/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Today I got a <a href="http://www.dotnetthoughts.net/2010/12/22/net-framework-initialization-error-%E2%80%93-unable-to-find-a-version-of-the-runtime-to-run-this-application/#comment-699">comment from Vitor</a>, Vitor is getting an exception like this while starting application.</p>
<blockquote><p>The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail.</p></blockquote>
<p>So I thought of work around this issue. To reproduce the issue, I tampered the exe.config file of one of my application, by removing &lt;configuration&gt; tag from the file. And it started throwing the exception.</p>
<div id="attachment_2336" class="wp-caption aligncenter" style="width: 310px"><img src="http://www.dotnetthoughts.net/wp-content/uploads/2012/02/side_by_side-300x96.jpg" alt="The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail." title="The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail." width="300" height="96" class="size-medium wp-image-2336" /><p class="wp-caption-text">The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail.</p></div>
<p>I verified the same with EventViewer, and I found a message like this, under Windows Logs > Application </p>
<blockquote><p>Activation context generation failed for &#8220;C:\CaptureItPlus\Binaries\CaptureItPlus.exe&#8221;. Error in manifest or policy file &#8220;C:\CaptureItPlus\Binaries\CaptureItPlus.exe.Config&#8221; on line 1. Invalid Xml syntax. </p></blockquote>
<p>The error message is pretty self explanatory. If you are not able to access the event viewer, the other option is using sxstrace.exe tool. You can enable run the sxstrace in trace mode, you can do this by following command.</p>
<pre class="brush: plain; title: ; notranslate">
sxstrace.exe Trace -logfile:C:\captureittrace.log
</pre>
<p>And execute the application. After getting exception, stop the tracing and you can parse the log file using following command.</p>
<pre class="brush: plain; title: ; notranslate">
sxstrace.exe Parse -logfile:C:\captureittrace.log -outfile:C:\captureittrace.txt
</pre>
<p>It is required because .log is a binary file. Now open the .txt file, you can see similar message,</p>
<blockquote><p>INFO: Parsing Application Config File C:\CaptureItPlus\Binaries\CaptureItPlus.exe.Config.<br />
ERROR: Line 1: XML Syntax error.<br />
ERROR: Activation Context generation failed.<br />
End Activation Context Generation.</p></blockquote>
<p>Now open the .exe.config and add the missing <configuration>, now double click on the application, this issue will be resolved. <img src='http://www.dotnetthoughts.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </configuration></p>
<div class="betterrelated"><p><strong>Related content:</strong></p>
<ol><li> <a href="http://www.dotnetthoughts.net/2012/01/11/how-to-use-net-assembly-in-vbscript/" title="Permanent link to How to use .Net assembly in VBScript">How to use .Net assembly in VBScript</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2011/11/02/debugging-nunit-tests-in-visual-studio-2010/" title="Permanent link to Debugging NUnit Tests in Visual Studio 2010">Debugging NUnit Tests in Visual Studio 2010</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2011/06/30/how-to-use-taskdialog-api-in-c/" title="Permanent link to How to use TaskDialog API in C#">How to use TaskDialog API in C#</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2011/08/03/windows-7-sdk-installation-success-or-error-status-1603/" title="Permanent link to Windows 7 SDK Installation success or error status: 1603">Windows 7 SDK Installation success or error status: 1603</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2011/01/18/how-to-unit-test-asynchronous-callbacks/" title="Permanent link to How to unit test asynchronous callbacks">How to unit test asynchronous callbacks</a>  </li>
</ol></div>]]></content:encoded>
			<wfw:commentRss>http://www.dotnetthoughts.net/2012/02/01/the-application-has-failed-to-start-because-its-side-by-side-configuration-is-incorrect-please-see-the-application-event-log-or-use-the-command-line-sxstrace-exe-tool-for-more-detail/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to create your own custom Accelerator for Internet Explorer</title>
		<link>http://www.dotnetthoughts.net/2012/01/29/how-to-create-your-own-custom-accelerator-for-internet-explorer/</link>
		<comments>http://www.dotnetthoughts.net/2012/01/29/how-to-create-your-own-custom-accelerator-for-internet-explorer/#comments</comments>
		<pubDate>Mon, 30 Jan 2012 03:07:49 +0000</pubDate>
		<dc:creator>Anuraj P</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Accelerator]]></category>
		<category><![CDATA[IE 8]]></category>
		<category><![CDATA[IE 9]]></category>
		<category><![CDATA[Internet Explorer]]></category>

		<guid isPermaLink="false">http://www.dotnetthoughts.net/?p=2323</guid>
		<description><![CDATA[The Accelerator feature of the IE helps to quickly perform everyday browsing tasks without leaving the website. Simply highlight the text, click on the blue Accelerator icon that appears above your selection, it will popup the different Accelerator options. For &#8230; <a href="http://www.dotnetthoughts.net/2012/01/29/how-to-create-your-own-custom-accelerator-for-internet-explorer/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">The Accelerator feature of the IE helps to quickly perform everyday browsing tasks without leaving the website. Simply highlight the text, click on the blue Accelerator icon that appears above your selection, it will popup the different Accelerator options. For example, with the &#8220;Map with Bing&#8221; Accelerator in Internet Explorer, you can get an in-place view of a map displayed directly on the page.</p>
<p>In this example, I am creating an Accelerator for searching StackOverflow.com. The Accelerator is simply an XML file, you can find more details about this XML specification <a href="http://msdn.microsoft.com/en-us/library/cc289775%28VS.85%29.aspx">here</a></p>
<p>Here is the implementation</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt;
&lt;openServiceDescription xmlns=&quot;http://www.microsoft.com/schemas/openservicedescription/1.0&quot;&gt;
&lt;homepageUrl&gt;http://www.stackoverflow.com/&lt;/homepageUrl&gt;
&lt;display&gt;
	&lt;name&gt;Search with Stackoverflow&lt;/name&gt;
	&lt;icon&gt;http://sstatic.net/stackoverflow/img/favicon.ico&lt;/icon&gt;
    &lt;description&gt;Search with Stackoverflow&lt;/description&gt;
&lt;/display&gt;  

&lt;activity category=&quot;Search&quot;&gt;
	&lt;activityAction context=&quot;selection&quot;&gt;
		&lt;execute method=&quot;get&quot; action=&quot;http://stackoverflow.com/search?q=&quot;&gt;
			&lt;parameter name=&quot;q&quot; value=&quot;{selection}&quot; type=&quot;text&quot; /&gt;
		&lt;/execute&gt;
	&lt;/activityAction&gt;
&lt;/activity&gt;
&lt;/openServiceDescription&gt;
</pre>
<p>Also you require a HTML file to install the Accelerator to IE. It will use <a href="http://msdn.microsoft.com/en-us/library/cc289789%28VS.85%29.aspx">window.external.AddService</a> method. Here is the HTML file.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;Add SO Search Accelerator&lt;/title&gt;
    &lt;meta content=&quot;text/html; charset=windows-1255&quot; http-equiv=&quot;Content-Type&quot;/&gt;
    &lt;meta name=&quot;GENERATOR&quot; content=&quot;MSHTML 8.00.6001.18372&quot;/&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;button id=&quot;myButton&quot;
   onclick=&quot;window.external.AddService('http://localhost/installs/search_so.xml')&quot;&gt;
                        Press to add SO Search Accelerator&lt;/button&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>Pressing on the button will popup, an Add Accelerator dialog, click on Add button, which will add the accelerator to your browser.</p>
<div id="attachment_2325" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-2325" title="Add Accelerator Dialog" src="http://www.dotnetthoughts.net/wp-content/uploads/2012/01/add_so_addon-300x218.jpg" alt="Add Accelerator Dialog" width="300" height="218" /><p class="wp-caption-text">Add Accelerator Dialog</p></div>
<p>And here is the Accelerator in action.</p>
<div id="attachment_2326" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-2326" title="Accelerator in Action" src="http://www.dotnetthoughts.net/wp-content/uploads/2012/01/so_addon_action-300x111.jpg" alt="Accelerator in Action" width="300" height="111" /><p class="wp-caption-text">Accelerator in Action</p></div>
<p>Happy Coding <img src='http://www.dotnetthoughts.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div class="betterrelated none"><p>No related content found.</p></div>]]></content:encoded>
			<wfw:commentRss>http://www.dotnetthoughts.net/2012/01/29/how-to-create-your-own-custom-accelerator-for-internet-explorer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to write an NUnit Addin</title>
		<link>http://www.dotnetthoughts.net/2012/01/23/how-to-write-an-nunit-addin/</link>
		<comments>http://www.dotnetthoughts.net/2012/01/23/how-to-write-an-nunit-addin/#comments</comments>
		<pubDate>Tue, 24 Jan 2012 04:51:09 +0000</pubDate>
		<dc:creator>Anuraj P</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Unit Testing]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[C#.Net]]></category>
		<category><![CDATA[NUnit]]></category>
		<category><![CDATA[NUnit AddIn]]></category>

		<guid isPermaLink="false">http://www.dotnetthoughts.net/?p=2309</guid>
		<description><![CDATA[From version 2.2.x NUnit supports AddIns. Addins can customize NUnit’s internal behavior such as the creation of tests and their execution. An Addin should to implement the interface NUnit.Core.Extensibility.IAddin, which can be found in the assembly nunit.core.interfaces. Also the NUnit.Core.Extensibility.NUnitAddinAttribute &#8230; <a href="http://www.dotnetthoughts.net/2012/01/23/how-to-write-an-nunit-addin/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">From version 2.2.x NUnit supports AddIns. Addins can customize NUnit’s internal behavior such as the creation of tests and their execution. An Addin should to implement the interface <em>NUnit.Core.Extensibility.IAddin</em>, which can be found in the assembly <em>nunit.core.interfaces</em>. Also the <em>NUnit.Core.Extensibility.NUnitAddinAttribute</em> must be applied to Addin class. The attribute parameters Name and Description represent the name of the extension and a description of what it does. The NUnit.Core.Extensibility.IAddin has only one method, Install(). The Install method is called by each host for which the addin has specified an ExtensionType. The addin should check that the necessary extension points are available and install itself, returning true for success or false for failure to install. The method will be called once for each extension host and &#8211; for Core extensions &#8211; each time a new test domain is loaded. Here is a minimal addin.</p>
<pre class="brush: csharp; title: ; notranslate">
namespace SampleAddIn
{
    using NUnit.Core.Extensibility;

    [NUnitAddin(Name = &quot;SampleAddIn&quot;, Description = &quot;This is a Sample AddIn&quot;)]
    public class SampleNUnitAddin : IAddin
    {
        #region IAddin Members

        public bool Install(IExtensionHost host)
        {
            return true;
        }

        #endregion
    }
}
</pre>
<p>You can install the Addin, by copying the assembly to bin\Addins folder, relative to NUnit installation directory. You can verify your addin by starting NUnit, Tools &gt; Addins menu.</p>
<div id="attachment_2311" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-2311" title="Registered AddIns Dialog" src="http://www.dotnetthoughts.net/wp-content/uploads/2012/01/nunit_addin-300x258.jpg" alt="Registered AddIns Dialog" width="300" height="258" /><p class="wp-caption-text">Registered AddIns Dialog</p></div>
<p>This Addin does nothing. It simply registers itself to NUnit. You can more details about NUnit Addins <a href="http://nunit.org/index.php?p=nunitAddins&amp;r=2.6">here</a><br />
If you are using VS2010, then please make sure your target framework is .Net 2.0. Otherwise Addin won&#8217;t work.</p>
<div class="betterrelated"><p><strong>Related content:</strong></p>
<ol><li> <a href="http://www.dotnetthoughts.net/2011/01/05/how-to-compare-equality-between-two-objects-in-nunit/" title="Permanent link to How to compare equality between two objects in NUnit">How to compare equality between two objects in NUnit</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2011/11/02/debugging-nunit-tests-in-visual-studio-2010/" title="Permanent link to Debugging NUnit Tests in Visual Studio 2010">Debugging NUnit Tests in Visual Studio 2010</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2010/12/23/how-to-do-code-coverage-with-nunit-tests/" title="Permanent link to How to do code coverage with NUnit tests">How to do code coverage with NUnit tests</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2010/12/15/how-to-integrate-nunit-with-visual-studio-2008/" title="Permanent link to How to integrate Nunit with Visual Studio 2008">How to integrate Nunit with Visual Studio 2008</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2011/09/25/getting-code-coverage-using-open-cover-and-nunit/" title="Permanent link to Getting Code coverage using Open Cover and NUnit">Getting Code coverage using Open Cover and NUnit</a>  </li>
</ol></div>]]></content:encoded>
			<wfw:commentRss>http://www.dotnetthoughts.net/2012/01/23/how-to-write-an-nunit-addin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to add MEX endpoints programmatically</title>
		<link>http://www.dotnetthoughts.net/2012/01/22/how-to-add-mex-endpoints-programmatically/</link>
		<comments>http://www.dotnetthoughts.net/2012/01/22/how-to-add-mex-endpoints-programmatically/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 02:49:13 +0000</pubDate>
		<dc:creator>Anuraj P</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[.Net 4.0]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Mex]]></category>
		<category><![CDATA[Mex EndPoint]]></category>

		<guid isPermaLink="false">http://www.dotnetthoughts.net/?p=2303</guid>
		<description><![CDATA[The Metadata Exchange Endpoint (MEX) is a special endpoint in WCF that exposes metadata used to describe a service.Without the MEX, you will not be able to use svcutil.exe to automatically generate a proxy class. Fortunately, it is a simply &#8230; <a href="http://www.dotnetthoughts.net/2012/01/22/how-to-add-mex-endpoints-programmatically/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The Metadata Exchange Endpoint (MEX) is a special endpoint in WCF that exposes metadata used to describe a service.Without the MEX, you will not be able to use svcutil.exe to automatically generate a proxy class.  Fortunately, it is a simply process to enable the MEX for your service. Here is the code which will add Mex endpoint programmatically. </p>
<pre class="brush: csharp; title: ; notranslate">
var metadataBehavior = serviceHost.Description.Behaviors.Find&lt;ServiceMetadataBehavior&gt;()
    ?? new ServiceMetadataBehavior();
serviceHost.Description.Behaviors.Add(metadataBehavior);
serviceHost.AddServiceEndpoint(typeof(IMetadataExchange),
    MetadataExchangeBindings.CreateMexHttpBinding(),
    &quot;http://localhost:8080/IService/Mex&quot;);
</pre>
<p>It should be noted that you are not required to enable HttpGet.  SvcUtil will still be able to access the MEX without it.  However, it is useful if you want to view the WSDL from a browser by going to the address of the service.  You cannot do so without enabling the HttpGet.</p>
<div class="betterrelated"><p><strong>Related content:</strong></p>
<ol><li> <a href="http://www.dotnetthoughts.net/2011/12/26/how-to-configure-a-wcf-service-to-use-port-sharing/" title="Permanent link to How to configure a WCF service to use Port Sharing">How to configure a WCF service to use Port Sharing</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2011/06/24/wcf-callbacks-%e2%80%93-a-quick-introduction/" title="Permanent link to WCF Callbacks – A quick introduction">WCF Callbacks – A quick introduction</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2011/03/20/how-to-create-restful-wcf-services/" title="Permanent link to How to create RESTful WCF services">How to create RESTful WCF services</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2011/04/01/how-to-post-data-to-restful-wcf-service/" title="Permanent link to How to post data to RESTful WCF service">How to post data to RESTful WCF service</a>  </li>
</ol></div>]]></content:encoded>
			<wfw:commentRss>http://www.dotnetthoughts.net/2012/01/22/how-to-add-mex-endpoints-programmatically/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to execute ms tests in parallel on multi-cpu / core machines</title>
		<link>http://www.dotnetthoughts.net/2012/01/18/how-to-execute-ms-tests-in-parallel-on-multi-cpu-core-machines/</link>
		<comments>http://www.dotnetthoughts.net/2012/01/18/how-to-execute-ms-tests-in-parallel-on-multi-cpu-core-machines/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 07:17:47 +0000</pubDate>
		<dc:creator>Anuraj P</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Unit Testing]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[MS Test]]></category>
		<category><![CDATA[MS Test Parallel]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>

		<guid isPermaLink="false">http://www.dotnetthoughts.net/?p=2278</guid>
		<description><![CDATA[VS 2010 supports running MS Tests in parallel. Most of the machines available in the market are multi-cpu / core machines. This will help us to increase the number of tests executing in same time, which will reduce total test &#8230; <a href="http://www.dotnetthoughts.net/2012/01/18/how-to-execute-ms-tests-in-parallel-on-multi-cpu-core-machines/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">VS 2010 supports running MS Tests in parallel. Most of the machines available in the market are multi-cpu / core machines. This will help us to increase the number of tests executing in same time, which will reduce total test time. But while writing tests, developers should make sure the tests are thread safe, if it is not, it may result in incorrect results, deadlocks etc.</p>
<p style="text-align: justify;">You can enable parallel test execution by editing the testsettings file, instead of double click and open the test settings dialog, open the file using Open with option in the context menu, and select XML(Text) Editor option, which open the testsettings file in XML Editor. In the XML, find the Execution element. Add parallelTestCount attribute to the Execution element(By default it will not be there).</p>
<div id="attachment_2292" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-2292" title="Parallel Test count attribute in testsettings file" src="http://www.dotnetthoughts.net/wp-content/uploads/2012/01/parallelTestcount_attribute-300x53.jpg" alt="Parallel Test count attribute in testsettings file" width="300" height="53" /><p class="wp-caption-text">Parallel Test count attribute in testsettings file</p></div>
<p style="text-align: justify;">By default it will be 1(if the attribute is not exists), other options are 0 for Auto configure we will use as many tests as we can based on your CPU and core count, and n, the number n of tests to run in parallel. Save the changes. Restart visual studio. And you are done.(Note: You need to restart visual studio, otherwise changes will not reflect.)</p>
<p>Here is a sample unit test</p>
<pre class="brush: csharp; title: ; notranslate">
[TestMethod]
public void TestMethod3()
{
    Console.WriteLine(Thread.CurrentThread.Name);
    Thread.Sleep(2000);
}
</pre>
<p>Now I am running few test cases (11) with no parallelTestCount attribute and here is the Test Results window and summary</p>
<div id="attachment_2283" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-2283" title="Test Results View - No attribute specified" src="http://www.dotnetthoughts.net/wp-content/uploads/2012/01/with_no_attribute-300x147.jpg" alt="Test Results View - No attribute specified" width="300" height="147" /><p class="wp-caption-text">Test Results View - No attribute specified</p></div>
<div id="attachment_2284" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-2284" title="Test Results summary - No attribute specified" src="http://www.dotnetthoughts.net/wp-content/uploads/2012/01/with_no_attribute_summary-300x139.jpg" alt="Test Results summary - No attribute specified" width="300" height="139" /><p class="wp-caption-text">Test Results summary - No attribute specified</p></div>
<p>Now I added the parallelTestCount attribute, with value of 5 and here is the Test Results window and summary, you can notice the time difference between two executions.</p>
<div id="attachment_2281" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-2281" title="Test Results View - parallelTestCount Attribute specified" src="http://www.dotnetthoughts.net/wp-content/uploads/2012/01/with_attribute-300x174.jpg" alt="Test Results View - parallelTestCount Attribute specified" width="300" height="174" /><p class="wp-caption-text">Test Results View - parallelTestCount Attribute specified</p></div>
<div id="attachment_2282" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-2282" title="Test Results Summary - With parallelTestCount attribute specified" src="http://www.dotnetthoughts.net/wp-content/uploads/2012/01/with_attribute_summary-300x153.jpg" alt="Test Results Summary - With parallelTestCount attribute specified" width="300" height="153" /><p class="wp-caption-text">Test Results Summary - With parallelTestCount attribute specified</p></div>
<p style="text-align: justify;">Of course there are many other factors that affect this. There is the cost of starting and tearing down the run, so you will see a lesser effect if you have a few tests. It also depends on the number of CPU/cores you have and of course how fast your tests execute.</p>
<p>Happy unit testing <img src='http://www.dotnetthoughts.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div class="betterrelated"><p><strong>Related content:</strong></p>
<ol><li> <a href="http://www.dotnetthoughts.net/2011/11/22/mstest-exe-does-not-deploy-all-items/" title="Permanent link to MSTest.exe does not deploy all items">MSTest.exe does not deploy all items</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2010/12/23/how-to-do-code-coverage-with-nunit-tests/" title="Permanent link to How to do code coverage with NUnit tests">How to do code coverage with NUnit tests</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2011/01/29/quick-introduction-to-ms-test/" title="Permanent link to Quick introduction to MS Test">Quick introduction to MS Test</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2011/10/29/test-impact-analysis-in-visual-studio-2010/" title="Permanent link to Test impact analysis in Visual Studio 2010">Test impact analysis in Visual Studio 2010</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2011/01/05/how-to-compare-equality-between-two-objects-in-nunit/" title="Permanent link to How to compare equality between two objects in NUnit">How to compare equality between two objects in NUnit</a>  </li>
</ol></div>]]></content:encoded>
			<wfw:commentRss>http://www.dotnetthoughts.net/2012/01/18/how-to-execute-ms-tests-in-parallel-on-multi-cpu-core-machines/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

