<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results for 'app:weblogs' matching tag 'Typemock'</title><link>http://msmvps.com/search/SearchResults.aspx?q=app:weblogs&amp;tag=Typemock&amp;orTags=0&amp;o=DateDescending</link><description>Search results for 'app:weblogs' matching tag 'Typemock'</description><dc:language>en-US</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>Getting Typemock Isolator running within a TFS 2012 build – part 2</title><link>http://msmvps.com/blogs/richardfennell/archive/2012/08/24/getting-typemock-isolator-running-within-a-tfs-2012-build-part-2.aspx</link><pubDate>Fri, 24 Aug 2012 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1815465</guid><dc:creator>Anonymous</dc:creator><description>&lt;p&gt;I posted &lt;a href="http://blogs.blackmarble.co.uk/blogs/rfennell/post/2012/08/04/Getting-Typemock-Isolator-running-within-a-TFS-2012-build.aspx"&gt;previously on getting Typemock 7.x running in a TFS 2012 RC build process&lt;/a&gt; . Well it seems &lt;a href="http://blogs.blackmarble.co.uk/blogs/rfennell/post/2012/08/04/blogs.blackmarble.co.uk/files/samples/typemock.bm.tfs2012.zip"&gt;the activities I previously published&lt;/a&gt; did not work on the TFS 2012 RTM build i.e if you do nothing other than upgrade your TFS server from RC to RTM a previously working build fails, no attempt was made to run any tests and I got the unhelpful error&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;TF900546: An unexpected error occurred while running the RunTests activity: &amp;#39;Executor process exited.&amp;#39;.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; TF900546 seems to be the generic – test failed error number. If you see it you will usually have to look elsewhere for anything helpful.&lt;/p&gt;  &lt;p&gt;So I assumed that the problem must be some difference with the TeamFoundation assemblies I was referencing between the RC and RTM versions, so I rebuilt my activities, all to no effect, I got the same error. So I did some more digging into the code. I found a number of issues, why these had not caused an issue before I don’t know:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Target property&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;If you do not specify a .NET version via the Target property of the TypeMockRegister activity it does not attempt to start interception. As setting this property every time you want to use the activity is a pain, I modified the activity so that if no Target property is passed then the value &lt;strong&gt;v4.0.30319&lt;/strong&gt; is used, the version of .NET 4.5 as it appears in the c:\windows\Microsoft.Net\framework folder. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt; Missing of the leading v if the Target value causes the TFS build agent to hang, I have no idea why. &lt;/p&gt;  &lt;p&gt;Once this change was made the build ran and it tried to run all my tests, but the ones involving Typemock failed, with the message&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Test method BuildProcessValidation.Tests.MSTestTypemockTests.DirtyTrickMockingWithTypemock_Email_is_sent_when_client_order_is_processed threw exception:        &lt;br /&gt;System.TypeInitializationException: The type initializer for &amp;#39;f5&amp;#39; threw an exception. ---&amp;gt; System.TypeInitializationException: The type initializer for &amp;#39;TypeMock.InterceptorsWrapper&amp;#39; threw an exception. ---&amp;gt; TypeMock.TypeMockException:         &lt;br /&gt;*** Typemock Isolator needs to be linked with Coverage Tool to run, to enable do one of the following:        &lt;br /&gt;&amp;#160;&amp;#160; 1. link the Coverage tool through the Typemock Isolator Configuration        &lt;br /&gt;&amp;#160;&amp;#160; 2. run tests via TMockRunner.exe -link        &lt;br /&gt;&amp;#160;&amp;#160; 3. use TypeMockStart tasks for MSBuild or NAnt with Link         &lt;br /&gt;For more information consult the documentation (see Code Coverage with Typemock Isolator topic)&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;On looking in the build box’s event log I saw the message&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;.NET Runtime version 4.0.30319.17929 - Loading profiler failed during CoCreateInstance.&amp;#160; Profiler CLSID: &amp;#39;{B146457E-9AED-4624-B1E5-968D274416EC}&amp;#39;.&amp;#160; HRESULT: 0x8007007e.&amp;#160; Process ID (decimal): 2068.&amp;#160; Message ID: [0x2504].&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;strong&gt;AutoDeployment&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Basically the issue was the Typemock interceptor, the profiler, was not being started because Typemock was not installed on the build box. To prove this I manually installed Typemock on the build box and the error went away, all my tests ran. So happy my activity basically worked, I removed Typemock from the build box and the problem returned, so I know I had an autodeployment issue.&lt;/p&gt;  &lt;p&gt;On checking the activity code again I found I was not handling the nullable boolean correctly for the AutoDeploy build argument of the type TypemockSettings. As soon as this was fixed and deployed by build leapt into life.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;In summary&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;So I am please to say I have a &lt;a href="http://blogs.blackmarble.co.uk/blogs/rfennell/post/2012/08/04/blogs.blackmarble.co.uk/files/samples/typemock.bm.tfs2012.zip"&gt;working activity&lt;/a&gt; again, as I said in my previous post I see this as stopgap measure until Typemock Release their official version. This set of activities have had minimal testing and I am not sure the undeploy logic is working fully, but as I don’t need this feature I am not worrying about it for now.&lt;/p&gt;  &lt;p&gt;Hope you find it useful in its current state.&lt;/p&gt;</description></item><item><title>Getting Typemock Isolator running within a TFS 2012 build – part 2</title><link>http://msmvps.com/blogs/rfennell/archive/2012/08/24/getting-typemock-isolator-running-within-a-tfs-2012-build-part-2.aspx</link><pubDate>Fri, 24 Aug 2012 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1815464</guid><dc:creator>Anonymous</dc:creator><description>&lt;p&gt;I posted &lt;a href="http://blogs.blackmarble.co.uk/blogs/rfennell/post/2012/08/04/Getting-Typemock-Isolator-running-within-a-TFS-2012-build.aspx"&gt;previously on getting Typemock 7.x running in a TFS 2012 RC build process&lt;/a&gt; . Well it seems &lt;a href="http://blogs.blackmarble.co.uk/blogs/rfennell/post/2012/08/04/blogs.blackmarble.co.uk/files/samples/typemock.bm.tfs2012.zip"&gt;the activities I previously published&lt;/a&gt; did not work on the TFS 2012 RTM build i.e if you do nothing other than upgrade your TFS server from RC to RTM a previously working build fails, no attempt was made to run any tests and I got the unhelpful error&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;TF900546: An unexpected error occurred while running the RunTests activity: &amp;#39;Executor process exited.&amp;#39;.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; TF900546 seems to be the generic – test failed error number. If you see it you will usually have to look elsewhere for anything helpful.&lt;/p&gt;  &lt;p&gt;So I assumed that the problem must be some difference with the TeamFoundation assemblies I was referencing between the RC and RTM versions, so I rebuilt my activities, all to no effect, I got the same error. So I did some more digging into the code. I found a number of issues, why these had not caused an issue before I don’t know:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Target property&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;If you do not specify a .NET version via the Target property of the TypeMockRegister activity it does not attempt to start interception. As setting this property every time you want to use the activity is a pain, I modified the activity so that if no Target property is passed then the value &lt;strong&gt;v4.0.30319&lt;/strong&gt; is used, the version of .NET 4.5 as it appears in the c:\windows\Microsoft.Net\framework folder. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt; Missing of the leading v if the Target value causes the TFS build agent to hang, I have no idea why. &lt;/p&gt;  &lt;p&gt;Once this change was made the build ran and it tried to run all my tests, but the ones involving Typemock failed, with the message&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Test method BuildProcessValidation.Tests.MSTestTypemockTests.DirtyTrickMockingWithTypemock_Email_is_sent_when_client_order_is_processed threw exception:        &lt;br /&gt;System.TypeInitializationException: The type initializer for &amp;#39;f5&amp;#39; threw an exception. ---&amp;gt; System.TypeInitializationException: The type initializer for &amp;#39;TypeMock.InterceptorsWrapper&amp;#39; threw an exception. ---&amp;gt; TypeMock.TypeMockException:         &lt;br /&gt;*** Typemock Isolator needs to be linked with Coverage Tool to run, to enable do one of the following:        &lt;br /&gt;&amp;#160;&amp;#160; 1. link the Coverage tool through the Typemock Isolator Configuration        &lt;br /&gt;&amp;#160;&amp;#160; 2. run tests via TMockRunner.exe -link        &lt;br /&gt;&amp;#160;&amp;#160; 3. use TypeMockStart tasks for MSBuild or NAnt with Link         &lt;br /&gt;For more information consult the documentation (see Code Coverage with Typemock Isolator topic)&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;On looking in the build box’s event log I saw the message&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;.NET Runtime version 4.0.30319.17929 - Loading profiler failed during CoCreateInstance.&amp;#160; Profiler CLSID: &amp;#39;{B146457E-9AED-4624-B1E5-968D274416EC}&amp;#39;.&amp;#160; HRESULT: 0x8007007e.&amp;#160; Process ID (decimal): 2068.&amp;#160; Message ID: [0x2504].&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;strong&gt;AutoDeployment&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Basically the issue was the Typemock interceptor, the profiler, was not being started because Typemock was not installed on the build box. To prove this I manually installed Typemock on the build box and the error went away, all my tests ran. So happy my activity basically worked, I removed Typemock from the build box and the problem returned, so I know I had an autodeployment issue.&lt;/p&gt;  &lt;p&gt;On checking the activity code again I found I was not handling the nullable boolean correctly for the AutoDeploy build argument of the type TypemockSettings. As soon as this was fixed and deployed by build leapt into life.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;In summary&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;So I am please to say I have a &lt;a href="http://blogs.blackmarble.co.uk/blogs/rfennell/post/2012/08/04/blogs.blackmarble.co.uk/files/samples/typemock.bm.tfs2012.zip"&gt;working activity&lt;/a&gt; again, as I said in my previous post I see this as stopgap measure until Typemock Release their official version. This set of activities have had minimal testing and I am not sure the undeploy logic is working fully, but as I don’t need this feature I am not worrying about it for now.&lt;/p&gt;  &lt;p&gt;Hope you find it useful in its current state.&lt;/p&gt;</description></item><item><title>Using an internal Nuget server to manage the Typemock assembly references.</title><link>http://msmvps.com/blogs/richardfennell/archive/2012/08/06/using-an-internal-nuget-server-to-manage-the-typemock-assembly-references.aspx</link><pubDate>Mon, 06 Aug 2012 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1814822</guid><dc:creator>Anonymous</dc:creator><description>&lt;p&gt;In &lt;a href="http://blogs.blackmarble.co.uk/blogs/rfennell/post/2012/08/04/Getting-Typemock-Isolator-running-within-a-TFS-2012-build.aspx"&gt;my last post&lt;/a&gt; I discussed the process I needed to go through to get &lt;a href="http://www.typemock.com"&gt;Typemock Isolator&lt;/a&gt; running under TFS 2012. In this process I used the Auto Deploy feature of Isolator. However this raised the&amp;#160; question of how to manage the references within projects. You cannot just assume the Typemock assemblies are in the GAC, they are not on the build box using auto deploy. You could get all projects to reference the auto deployment location in source control. However, if you use build process templates across projects it might be you do not want to have production code referencing build tools in the build process are directly.&lt;/p&gt;  &lt;p&gt;For most issues of this nature we now use &lt;a href="http://nuget.codeplex.com/"&gt;Nuget&lt;/a&gt;. At Black Marble we make use of the public Nuget repository for tools such as XUnit, SpecFlow etc. but we also have an internal Nuget repository for our own cross project code libraries. This includes licensing modules, utility and data loggers etc.&lt;/p&gt;  &lt;p&gt;It struck me after writing the last post that the best way to manage my Typemock references was with a Nuget package, obviously not a public one, this would be for Typemock to produce. So I create one to place on our internal Nuget server that just contained the two DLLs I needed to reference (I could include more but we usually only need the core and act assert arrange assemblies).&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.blackmarble.co.uk/blogs/rfennell/image.axd?picture=image_61.png"&gt;&lt;img title="image" style="border-top:0px;border-right:0px;border-bottom:0px;border-left:0px;display:inline;" border="0" alt="image" src="http://blogs.blackmarble.co.uk/blogs/rfennell/image.axd?picture=image_thumb_61.png" width="507" height="339" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;IT IS IMPORANT TO NOTE that using a Nuget package here in no way alters the Typemock licensing. Your developers still each need a license, they also need to install Typemock Isolator, to be able to run the tests and your build box needs to use auto deployment. All using Nuget means is that you are now managing references in the same way for Typemock as any other Nuget managed set of assemblies. You are internally consistent, which I like.&lt;/p&gt;  &lt;p&gt;So in theory as new versions of Typemock are released I can update my internal Nuget package allowing projects to use the version they require. It will be interesting to see how well this works in practice.&lt;/p&gt;</description></item><item><title>Getting Typemock Isolator running within a TFS 2012 build</title><link>http://msmvps.com/blogs/richardfennell/archive/2012/08/04/getting-typemock-isolator-running-within-a-tfs-2012-build.aspx</link><pubDate>Sat, 04 Aug 2012 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1814763</guid><dc:creator>Anonymous</dc:creator><description>&lt;p&gt;I have &lt;a href="http://blogs.blackmarble.co.uk/blogs/rfennell/post/2010/03/08/lessons-learnt-building-a-custom-activity-to-run-typemock-isolator-in-vs2010-team-build.aspx"&gt;posted in the past about getting Typemock Isolator to function within the TFS build process&lt;/a&gt;. In &lt;a href="http://docs.typemock.com/Isolator/##typemock.chm/Documentation/MSBuild.html"&gt;TFS 2008 it was easy&lt;/a&gt;, you just ran a couple of MSBUILD tasks that started/stopped the Typemock Isolator inception process (the bit that does the magic other mocking frameworks cannot do). However with TFS 2010’s move to a windows workflow based build model it became more difficult. This was due to the parallel processing nature of the 2010 build process, running a single task to enable interception cannot be guaranteed to occur in the correct thread (or maybe even on the correct build agent). So &lt;a href="http://www.typemock.com/files/Addons/VS2010%20TypemockBuildActivity%201.0.0.0.zip"&gt;I wrote wrapper build activity for MStest to get around this problem&lt;/a&gt;. Howerver, with the release of &lt;a href="http://docs.typemock.com/Isolator/##typemock.chm/Documentation/TFSBuild.html"&gt;Typemock Isolator 6.2 direct support for TFS 2010 was added&lt;/a&gt; and these TFS build activities have been refined in later releases. In the current beta (7.0.8) you get a pre-created TFS build process template to get you going and some great auto deploy features, but more of that later.&lt;/p&gt;  &lt;p&gt;The problem was I wanted to put Isolator based tests within a TFS 2012 build process. I &lt;a href="http://blogs.blackmarble.co.uk/blogs/rfennell/post/2012/06/23/Why-Typemock-Isolator-does-not-work-on-TFS-2012-Build-and-what-you-can-do-about-it.aspx"&gt;posted before about my initial thoughts on the problem&lt;/a&gt;. The main problem is that TFS build activities have to be built against the correct version of the TFS API assemblies (this is the reason the &lt;a href="http://tfsbuildextensions.codeplex.com/"&gt;community custom activities&lt;/a&gt; have two sets of DLLs in the release ZIP file). So out the box you can’t use the &lt;strong&gt;Typemock.TFS2010.DLL&lt;/strong&gt; with TFS 2012 as it is built against the 2010 API.&lt;/p&gt;  &lt;p&gt;Also you cannot just use the Typemock provided sample build process template. This is built against 2010 too, so full of 2010 activities which all fail.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;What I tried that did not work (so don’t waste your time)&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;So I took a copy of the default TFS 2012 build process template and followed the process to add the &lt;strong&gt;Typemock.TFS2010.DLL&lt;/strong&gt; containing the Typemock activities to the Visual Studio 2012 toolbox (&lt;a href="http://tfsbuildextensions.codeplex.com/wikipage?title=How%20to%20integrate%20the%20extensions%20into%20a%20build%20template&amp;amp;referringTitle=Documentation"&gt;the community activity documentation provides a good overview of this strangely complex process &lt;/a&gt; also see the &lt;a href="http://vsarbuildguide.codeplex.com/"&gt;ALM Rangers guidance&lt;/a&gt;). I then added the &lt;strong&gt;TypemockRegister&lt;/strong&gt; and &lt;strong&gt;TypemockStart&lt;/strong&gt; activities at the start of the testing block. For initial tests I did not both adding the &lt;strong&gt;TypemockStop&lt;/strong&gt; activity&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.blackmarble.co.uk/blogs/rfennell/image.axd?picture=image_56.png"&gt;&lt;img title="image" style="border-left-width:0px;border-right-width:0px;border-bottom-width:0px;display:inline;border-top-width:0px;" border="0" alt="image" src="http://blogs.blackmarble.co.uk/blogs/rfennell/image.axd?picture=image_thumb_56.png" width="658" height="298" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;I then made sure that&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Typemock was installed on the build agent PC&lt;/li&gt;    &lt;li&gt;The &lt;strong&gt;Typemock.TFS2010.dll&lt;/strong&gt; was in the correct &lt;strong&gt;CustomActivities&lt;/strong&gt; folder in source control&lt;/li&gt;    &lt;li&gt;The build controller was set to load activities from the &lt;strong&gt;CustomActivities&lt;/strong&gt; folder. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;However, when I tried to queue this build I got an error&amp;#160; &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Exception Message: Object reference not set to an instance of an object. (type NullReferenceException)      &lt;br /&gt;Exception Stack Trace:&amp;#160;&amp;#160;&amp;#160; at TypeMock.CLI.Common.TypeMockRegisterInfo.Execute()&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;a href="http://blogs.blackmarble.co.uk/blogs/rfennell/image.axd?picture=image_57.png"&gt;&lt;img title="image" style="border-left-width:0px;border-right-width:0px;border-bottom-width:0px;display:inline;border-top-width:0px;" border="0" alt="image" src="http://blogs.blackmarble.co.uk/blogs/rfennell/image.axd?picture=image_thumb_57.png" width="664" height="364" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The issue was that though Typemock was installed, the required DLLs could not be found. Checking in a bit more detailed (by running the build with diagnostic level of logging and using &lt;a href="http://msdn.microsoft.com/en-us/library/e74a18c4.aspx"&gt;Fuslogvw&lt;/a&gt;) I saw it was trying load the wrong versions of DLLs as expected. So the first thing I tried to use was binding redirection (&lt;a href="http://blogs.blackmarble.co.uk/blogs/rfennell/post/2009/05/29/addressing-binding-issues-with-with-ivonna-2-0-0-using-lt-dependentassembly-gt-in-web-config.aspx"&gt;a technique I used before with similar Typemock&lt;/a&gt;). This in effect told the Typemock activity to use the 2012 DLLs when it asks for the 2010 ones. This is done by using an XML config file &lt;strong&gt;(Typemock.TFS2010.DLL.config)&lt;/strong&gt;&amp;#160; in the same folder as the DLL file.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;lt;configuration&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160; &amp;lt;runtime&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;assemblyBinding xmlns=&amp;quot;urn:schemas-microsoft-com:asm.v1&amp;quot;&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;dependentAssembly&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;assemblyIdentity name=&amp;quot;Microsoft.TeamFoundation.Build.Workflow&amp;quot;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; publicKeyToken=&amp;quot;b03f5f7f11d50a3a&amp;quot;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; culture=&amp;quot;neutral&amp;quot; /&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;bindingRedirect oldVersion=&amp;quot;10.0.0.0&amp;quot;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; newVersion=&amp;quot;11.0.0.0&amp;quot;/&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/dependentAssembly&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;dependentAssembly&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;assemblyIdentity name=&amp;quot;Microsoft.TeamFoundation.Build.Client&amp;quot;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; publicKeyToken=&amp;quot;b03f5f7f11d50a3a&amp;quot;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; culture=&amp;quot;neutral&amp;quot; /&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;bindingRedirect oldVersion=&amp;quot;10.0.0.0&amp;quot;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; newVersion=&amp;quot;11.0.0.0&amp;quot;/&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/dependentAssembly&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;publisherPolicy apply=&amp;quot;no&amp;quot;&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/assemblyBinding&amp;gt;bu       &lt;br /&gt;&amp;#160;&amp;#160; &amp;lt;/runtime&amp;gt;       &lt;br /&gt;&amp;lt;/configuration&amp;gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I first tried to add this file to the &lt;strong&gt;CustomActivities&lt;/strong&gt; source control folder, where the custom activities are loaded from by the build agent, but that did not work. I could only get it to work if I put both the DLL and the config files in the&amp;#160; &lt;strong&gt;C:\Program Files\Microsoft team Foundation Server 1.0\Tools&lt;/strong&gt; folder on the build agent. This is not a way I like to work, too messy having to fiddle with the build agent file system.&lt;/p&gt;  &lt;p&gt;Once this setting was made I tried a build again and got the build process to load, but the &lt;strong&gt;TypemockRegister&lt;/strong&gt; activity failed as the &lt;strong&gt;Typemock&lt;/strong&gt; settings argument was not set. Strangely Typemock have chosen to pass in their parameters as a complex type (of the type&lt;strong&gt; TypemockSettings&lt;/strong&gt;) as opposed to four strings. Also you would expect this argument to be passed directly into their custom activities by getting activity properties to argument values, but this is not how it is done. The Typemock activities know to look directly for an argument called &lt;strong&gt;Typemock&lt;/strong&gt;. This does make adding the activities easier, but not obvious if you are not expecting it. So I added this argument to the build definition in Visual Studio 2012 and checked it in, but when I tried to set the argument value for a specific build it gave the error that the DLL containing the type &lt;strong&gt;Typemock.TFS2010.TypemockSettings&lt;/strong&gt; could not be loaded, again the TFS 2010/2012 API issue, this time within Visual&amp;#160; Studio 2012&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.blackmarble.co.uk/blogs/rfennell/image.axd?picture=clip_image002_2.jpg"&gt;&lt;img title="clip_image002" style="border-left-width:0px;border-right-width:0px;border-bottom-width:0px;display:inline;border-top-width:0px;" border="0" alt="clip_image002" src="http://blogs.blackmarble.co.uk/blogs/rfennell/image.axd?picture=clip_image002_thumb_2.jpg" width="844" height="176" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;At this point I gave up on binding redirection, I had wasted a lot more time than this post makes it sound. So I removed all the work I had previously done and thought again. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;What did work&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;I decided that the only sensible option was to recreate the functionality of the Typemock activity against the 2012 API. So I used &lt;a href="http://www.telerik.com/products/decompiler.aspx"&gt;Telerik JustDecompile&lt;/a&gt; to open up the &lt;strong&gt;Typemock.Tfs2010.dll&lt;/strong&gt; assembly and had a look inside. In Visual Studio 2012 I then created a new C# class library project called &lt;strong&gt;Typemock.BM.TFS20102&lt;/strong&gt; targeting .NET 4. I then basically cut and pasted the classes read from JustDecompile into classes of the same name in the new project. I then added references to the TFS 2012 API assemblies and any other assemblies needed and compiled the project. The one class I had problems with the &lt;strong&gt;TypemockStart&lt;/strong&gt;, specifically the unpacking of the properties in the &lt;strong&gt;InternalExecute&lt;/strong&gt; method. The reflected code by JustDecompile was full of what looked to be duplicated array copying which did not compile. So I simplified this to map the properties to the right names.&lt;/p&gt;  &lt;p&gt;You can &lt;a&gt;download a copy of my Typemock.BM.TFS2012.Dll from here&lt;/a&gt;, so you don’t have to go through the process yourself.&lt;/p&gt;  &lt;p&gt;I now had a TFS 2012 custom build activity. I took this new activity and put it the &lt;strong&gt;CustomActivities&lt;/strong&gt; folder. Next I took an unedited version of the default 2012 build process template and added these new &lt;strong&gt;Typemockregister&lt;/strong&gt;, &lt;strong&gt;TypemockStart &lt;/strong&gt;(at the start of the test block) and &lt;strong&gt;TypemockStop&lt;/strong&gt; (at the end of the test block) activities as well as a Typemock argument (of &lt;strong&gt;TypemockSettings&lt;/strong&gt; type). I checked this new template into TFS, and then created a build setting the Typemock argument settings.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.blackmarble.co.uk/blogs/rfennell/image.axd?picture=image_58.png"&gt;&lt;img title="image" style="border-left-width:0px;border-right-width:0px;border-bottom-width:0px;display:inline;border-top-width:0px;" border="0" alt="image" src="http://blogs.blackmarble.co.uk/blogs/rfennell/image.axd?picture=image_thumb_58.png" width="856" height="423" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now at this point it is worth mentioning the nice feature of AutoDeploy. This allows you to use Typemock without having it installed on the build agent, thus making build agent management easier. You copy the &lt;strong&gt;AutoDeploy&lt;/strong&gt; folder from the Typemock installation folder into source control (though a rename might be sensible so you remember it is for Typemock auto deployment and not anything else). You can then set the four argument properties&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;The location of the auto deployment folder in source control&lt;/li&gt;    &lt;li&gt;A switch to enable auto deployment&lt;/li&gt;    &lt;li&gt;Your Typemock license settings. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;By using the auto deployment feature I was able to uninstall Typemock on the build agent.&lt;/p&gt;  &lt;p&gt;So I tried a build using these setting, all the build activities loaded Ok and the &lt;strong&gt;TypemockSettings&lt;/strong&gt; was read, but my project compile failed. As I had uninstalled Typemock on my build agent all the references to Typemock assemblies in the GAC failed. These references were fine on a development PC which had Typemock installed not on the build agent which did not.&lt;/p&gt;  &lt;p&gt;So I needed to point the references in my project to another location. Typemock have thought of this too and provide a tools to remap the references that you can find on the Typemock menu&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.blackmarble.co.uk/blogs/rfennell/image.axd?picture=image_59.png"&gt;&lt;img title="image" style="border-left-width:0px;border-right-width:0px;border-bottom-width:0px;display:inline;border-top-width:0px;" border="0" alt="image" src="http://blogs.blackmarble.co.uk/blogs/rfennell/image.axd?picture=image_thumb_59.png" width="386" height="265" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;You can use this tool, or do it manually. &lt;/p&gt;  &lt;p&gt;You could re-point the references to the same location you used for the AutoDeploy feature. However I prefer to keep my project references separate to my infrastructure (build activities etc.) as I use the same build templates cross project. For our projects we arrange source control so we have the structure in the general form (ignoring branch for simplicity)&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;/$     &lt;br /&gt;A team project      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; BuildProcessTemplate       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; CustomActivities       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; AutoDeploy       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; MyProject-1       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Src&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Solution1A.sln      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Lib&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; [Nuget packages]       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; AutoDeploy       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; other assemblies       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; MyProject-2       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Src&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Solution2a.sln      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Lib&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; [Nuget packages]       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; AutoDeploy       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; other assemblies&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I make sure we put all assemblies referenced in the lib folder, including those from Nuget using a nuget.config file in the src folder with the SLN file e.g.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;lt;settings&amp;gt;      &lt;br /&gt;&amp;#160; &amp;lt;repositoryPath&amp;gt;..\Lib\&amp;lt;/repositoryPath&amp;gt;       &lt;br /&gt;&amp;lt;/settings&amp;gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;This structure might not be to your taste, but I like it as it means all projects are independent, and so is the build process. The downside is you have to manage the references for the projects and build separately, but I see this as good practice. You probably don’t share want to reference and Nuget packages between separate projects/solutions.&lt;/p&gt;  &lt;p&gt;So now we have a 2012 build process that can start Typemock Isolator, and a sample project that contains Typemock based tests, some using MSTest and some using XUnit (remember Visual Studio 2012 support multiple unit testing frameworks not just MSTest, &lt;a href="http://blogs.blackmarble.co.uk/blogs/rfennell/post/2012/03/27/Unit-testing-in-VS11Beta-and-getting-your-tests-to-run-on-the-new-TFSPreview-build-service.aspx"&gt;see here on how to set this up for TFS build&lt;/a&gt;). When the build is run I can see all my unit tests pass to Typemock isolator must be starting correctly&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.blackmarble.co.uk/blogs/rfennell/image.axd?picture=image_60.png"&gt;&lt;img title="image" style="border-left-width:0px;border-right-width:0px;border-bottom-width:0px;display:inline;border-top-width:0px;" border="0" alt="image" src="http://blogs.blackmarble.co.uk/blogs/rfennell/image.axd?picture=image_thumb_60.png" width="865" height="603" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;So for me this is a reasonable work around until Typemock ship a TFS 2012 specific version. &lt;a&gt;Hope this file saves you some time if you use Typemock and TFS 2012&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Getting Typemock Isolator running within a TFS 2012 build</title><link>http://msmvps.com/blogs/rfennell/archive/2012/08/04/getting-typemock-isolator-running-within-a-tfs-2012-build.aspx</link><pubDate>Sat, 04 Aug 2012 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1814762</guid><dc:creator>Anonymous</dc:creator><description>&lt;p&gt;I have &lt;a href="http://blogs.blackmarble.co.uk/blogs/rfennell/post/2010/03/08/lessons-learnt-building-a-custom-activity-to-run-typemock-isolator-in-vs2010-team-build.aspx"&gt;posted in the past about getting Typemock Isolator to function within the TFS build process&lt;/a&gt;. In &lt;a href="http://docs.typemock.com/Isolator/##typemock.chm/Documentation/MSBuild.html"&gt;TFS 2008 it was easy&lt;/a&gt;, you just ran a couple of MSBUILD tasks that started/stopped the Typemock Isolator inception process (the bit that does the magic other mocking frameworks cannot do). However with TFS 2010’s move to a windows workflow based build model it became more difficult. This was due to the parallel processing nature of the 2010 build process, running a single task to enable interception cannot be guaranteed to occur in the correct thread (or maybe even on the correct build agent). So &lt;a href="http://www.typemock.com/files/Addons/VS2010%20TypemockBuildActivity%201.0.0.0.zip"&gt;I wrote wrapper build activity for MStest to get around this problem&lt;/a&gt;. Howerver, with the release of &lt;a href="http://docs.typemock.com/Isolator/##typemock.chm/Documentation/TFSBuild.html"&gt;Typemock Isolator 6.2 direct support for TFS 2010 was added&lt;/a&gt; and these TFS build activities have been refined in later releases. In the current beta (7.0.8) you get a pre-created TFS build process template to get you going and some great auto deploy features, but more of that later.&lt;/p&gt;  &lt;p&gt;The problem was I wanted to put Isolator based tests within a TFS 2012 build process. I &lt;a href="http://blogs.blackmarble.co.uk/blogs/rfennell/post/2012/06/23/Why-Typemock-Isolator-does-not-work-on-TFS-2012-Build-and-what-you-can-do-about-it.aspx"&gt;posted before about my initial thoughts on the problem&lt;/a&gt;. The main problem is that TFS build activities have to be built against the correct version of the TFS API assemblies (this is the reason the &lt;a href="http://tfsbuildextensions.codeplex.com/"&gt;community custom activities&lt;/a&gt; have two sets of DLLs in the release ZIP file). So out the box you can’t use the &lt;strong&gt;Typemock.TFS2010.DLL&lt;/strong&gt; with TFS 2012 as it is built against the 2010 API.&lt;/p&gt;  &lt;p&gt;Also you cannot just use the Typemock provided sample build process template. This is built against 2010 too, so full of 2010 activities which all fail.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;What I tried that did not work (so don’t waste your time)&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;So I took a copy of the default TFS 2012 build process template and followed the process to add the &lt;strong&gt;Typemock.TFS2010.DLL&lt;/strong&gt; containing the Typemock activities to the Visual Studio 2012 toolbox (&lt;a href="http://tfsbuildextensions.codeplex.com/wikipage?title=How%20to%20integrate%20the%20extensions%20into%20a%20build%20template&amp;amp;referringTitle=Documentation"&gt;the community activity documentation provides a good overview of this strangely complex process &lt;/a&gt; also see the &lt;a href="http://vsarbuildguide.codeplex.com/"&gt;ALM Rangers guidance&lt;/a&gt;). I then added the &lt;strong&gt;TypemockRegister&lt;/strong&gt; and &lt;strong&gt;TypemockStart&lt;/strong&gt; activities at the start of the testing block. For initial tests I did not both adding the &lt;strong&gt;TypemockStop&lt;/strong&gt; activity&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.blackmarble.co.uk/blogs/rfennell/image.axd?picture=image_56.png"&gt;&lt;img title="image" style="border-left-width:0px;border-right-width:0px;border-bottom-width:0px;display:inline;border-top-width:0px;" border="0" alt="image" src="http://blogs.blackmarble.co.uk/blogs/rfennell/image.axd?picture=image_thumb_56.png" width="658" height="298" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;I then made sure that&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Typemock was installed on the build agent PC&lt;/li&gt;    &lt;li&gt;The &lt;strong&gt;Typemock.TFS2010.dll&lt;/strong&gt; was in the correct &lt;strong&gt;CustomActivities&lt;/strong&gt; folder in source control&lt;/li&gt;    &lt;li&gt;The build controller was set to load activities from the &lt;strong&gt;CustomActivities&lt;/strong&gt; folder. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;However, when I tried to queue this build I got an error&amp;#160; &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Exception Message: Object reference not set to an instance of an object. (type NullReferenceException)      &lt;br /&gt;Exception Stack Trace:&amp;#160;&amp;#160;&amp;#160; at TypeMock.CLI.Common.TypeMockRegisterInfo.Execute()&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;a href="http://blogs.blackmarble.co.uk/blogs/rfennell/image.axd?picture=image_57.png"&gt;&lt;img title="image" style="border-left-width:0px;border-right-width:0px;border-bottom-width:0px;display:inline;border-top-width:0px;" border="0" alt="image" src="http://blogs.blackmarble.co.uk/blogs/rfennell/image.axd?picture=image_thumb_57.png" width="664" height="364" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The issue was that though Typemock was installed, the required DLLs could not be found. Checking in a bit more detailed (by running the build with diagnostic level of logging and using &lt;a href="http://msdn.microsoft.com/en-us/library/e74a18c4.aspx"&gt;Fuslogvw&lt;/a&gt;) I saw it was trying load the wrong versions of DLLs as expected. So the first thing I tried to use was binding redirection (&lt;a href="http://blogs.blackmarble.co.uk/blogs/rfennell/post/2009/05/29/addressing-binding-issues-with-with-ivonna-2-0-0-using-lt-dependentassembly-gt-in-web-config.aspx"&gt;a technique I used before with similar Typemock&lt;/a&gt;). This in effect told the Typemock activity to use the 2012 DLLs when it asks for the 2010 ones. This is done by using an XML config file &lt;strong&gt;(Typemock.TFS2010.DLL.config)&lt;/strong&gt;&amp;#160; in the same folder as the DLL file.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;lt;configuration&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160; &amp;lt;runtime&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;assemblyBinding xmlns=&amp;quot;urn:schemas-microsoft-com:asm.v1&amp;quot;&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;dependentAssembly&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;assemblyIdentity name=&amp;quot;Microsoft.TeamFoundation.Build.Workflow&amp;quot;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; publicKeyToken=&amp;quot;b03f5f7f11d50a3a&amp;quot;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; culture=&amp;quot;neutral&amp;quot; /&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;bindingRedirect oldVersion=&amp;quot;10.0.0.0&amp;quot;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; newVersion=&amp;quot;11.0.0.0&amp;quot;/&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/dependentAssembly&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;dependentAssembly&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;assemblyIdentity name=&amp;quot;Microsoft.TeamFoundation.Build.Client&amp;quot;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; publicKeyToken=&amp;quot;b03f5f7f11d50a3a&amp;quot;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; culture=&amp;quot;neutral&amp;quot; /&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;bindingRedirect oldVersion=&amp;quot;10.0.0.0&amp;quot;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; newVersion=&amp;quot;11.0.0.0&amp;quot;/&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/dependentAssembly&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;publisherPolicy apply=&amp;quot;no&amp;quot;&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/assemblyBinding&amp;gt;bu       &lt;br /&gt;&amp;#160;&amp;#160; &amp;lt;/runtime&amp;gt;       &lt;br /&gt;&amp;lt;/configuration&amp;gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I first tried to add this file to the &lt;strong&gt;CustomActivities&lt;/strong&gt; source control folder, where the custom activities are loaded from by the build agent, but that did not work. I could only get it to work if I put both the DLL and the config files in the&amp;#160; &lt;strong&gt;C:\Program Files\Microsoft team Foundation Server 1.0\Tools&lt;/strong&gt; folder on the build agent. This is not a way I like to work, too messy having to fiddle with the build agent file system.&lt;/p&gt;  &lt;p&gt;Once this setting was made I tried a build again and got the build process to load, but the &lt;strong&gt;TypemockRegister&lt;/strong&gt; activity failed as the &lt;strong&gt;Typemock&lt;/strong&gt; settings argument was not set. Strangely Typemock have chosen to pass in their parameters as a complex type (of the type&lt;strong&gt; TypemockSettings&lt;/strong&gt;) as opposed to four strings. Also you would expect this argument to be passed directly into their custom activities by getting activity properties to argument values, but this is not how it is done. The Typemock activities know to look directly for an argument called &lt;strong&gt;Typemock&lt;/strong&gt;. This does make adding the activities easier, but not obvious if you are not expecting it. So I added this argument to the build definition in Visual Studio 2012 and checked it in, but when I tried to set the argument value for a specific build it gave the error that the DLL containing the type &lt;strong&gt;Typemock.TFS2010.TypemockSettings&lt;/strong&gt; could not be loaded, again the TFS 2010/2012 API issue, this time within Visual&amp;#160; Studio 2012&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.blackmarble.co.uk/blogs/rfennell/image.axd?picture=clip_image002_2.jpg"&gt;&lt;img title="clip_image002" style="border-left-width:0px;border-right-width:0px;border-bottom-width:0px;display:inline;border-top-width:0px;" border="0" alt="clip_image002" src="http://blogs.blackmarble.co.uk/blogs/rfennell/image.axd?picture=clip_image002_thumb_2.jpg" width="844" height="176" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;At this point I gave up on binding redirection, I had wasted a lot more time than this post makes it sound. So I removed all the work I had previously done and thought again. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;What did work&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;I decided that the only sensible option was to recreate the functionality of the Typemock activity against the 2012 API. So I used &lt;a href="http://www.telerik.com/products/decompiler.aspx"&gt;Telerik JustDecompile&lt;/a&gt; to open up the &lt;strong&gt;Typemock.Tfs2010.dll&lt;/strong&gt; assembly and had a look inside. In Visual Studio 2012 I then created a new C# class library project called &lt;strong&gt;Typemock.BM.TFS20102&lt;/strong&gt; targeting .NET 4. I then basically cut and pasted the classes read from JustDecompile into classes of the same name in the new project. I then added references to the TFS 2012 API assemblies and any other assemblies needed and compiled the project. The one class I had problems with the &lt;strong&gt;TypemockStart&lt;/strong&gt;, specifically the unpacking of the properties in the &lt;strong&gt;InternalExecute&lt;/strong&gt; method. The reflected code by JustDecompile was full of what looked to be duplicated array copying which did not compile. So I simplified this to map the properties to the right names.&lt;/p&gt;  &lt;p&gt;You can &lt;a&gt;download a copy of my Typemock.BM.TFS2012.Dll from here&lt;/a&gt;, so you don’t have to go through the process yourself.&lt;/p&gt;  &lt;p&gt;I now had a TFS 2012 custom build activity. I took this new activity and put it the &lt;strong&gt;CustomActivities&lt;/strong&gt; folder. Next I took an unedited version of the default 2012 build process template and added these new &lt;strong&gt;Typemockregister&lt;/strong&gt;, &lt;strong&gt;TypemockStart &lt;/strong&gt;(at the start of the test block) and &lt;strong&gt;TypemockStop&lt;/strong&gt; (at the end of the test block) activities as well as a Typemock argument (of &lt;strong&gt;TypemockSettings&lt;/strong&gt; type). I checked this new template into TFS, and then created a build setting the Typemock argument settings.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.blackmarble.co.uk/blogs/rfennell/image.axd?picture=image_58.png"&gt;&lt;img title="image" style="border-left-width:0px;border-right-width:0px;border-bottom-width:0px;display:inline;border-top-width:0px;" border="0" alt="image" src="http://blogs.blackmarble.co.uk/blogs/rfennell/image.axd?picture=image_thumb_58.png" width="856" height="423" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now at this point it is worth mentioning the nice feature of AutoDeploy. This allows you to use Typemock without having it installed on the build agent, thus making build agent management easier. You copy the &lt;strong&gt;AutoDeploy&lt;/strong&gt; folder from the Typemock installation folder into source control (though a rename might be sensible so you remember it is for Typemock auto deployment and not anything else). You can then set the four argument properties&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;The location of the auto deployment folder in source control&lt;/li&gt;    &lt;li&gt;A switch to enable auto deployment&lt;/li&gt;    &lt;li&gt;Your Typemock license settings. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;By using the auto deployment feature I was able to uninstall Typemock on the build agent.&lt;/p&gt;  &lt;p&gt;So I tried a build using these setting, all the build activities loaded Ok and the &lt;strong&gt;TypemockSettings&lt;/strong&gt; was read, but my project compile failed. As I had uninstalled Typemock on my build agent all the references to Typemock assemblies in the GAC failed. These references were fine on a development PC which had Typemock installed not on the build agent which did not.&lt;/p&gt;  &lt;p&gt;So I needed to point the references in my project to another location. Typemock have thought of this too and provide a tools to remap the references that you can find on the Typemock menu&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.blackmarble.co.uk/blogs/rfennell/image.axd?picture=image_59.png"&gt;&lt;img title="image" style="border-left-width:0px;border-right-width:0px;border-bottom-width:0px;display:inline;border-top-width:0px;" border="0" alt="image" src="http://blogs.blackmarble.co.uk/blogs/rfennell/image.axd?picture=image_thumb_59.png" width="386" height="265" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;You can use this tool, or do it manually. &lt;/p&gt;  &lt;p&gt;You could re-point the references to the same location you used for the AutoDeploy feature. However I prefer to keep my project references separate to my infrastructure (build activities etc.) as I use the same build templates cross project. For our projects we arrange source control so we have the structure in the general form (ignoring branch for simplicity)&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;/$     &lt;br /&gt;A team project      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; BuildProcessTemplate       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; CustomActivities       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; AutoDeploy       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; MyProject-1       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Src&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Solution1A.sln      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Lib&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; [Nuget packages]       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; AutoDeploy       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; other assemblies       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; MyProject-2       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Src&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Solution2a.sln      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Lib&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; [Nuget packages]       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; AutoDeploy       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; other assemblies&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I make sure we put all assemblies referenced in the lib folder, including those from Nuget using a nuget.config file in the src folder with the SLN file e.g.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;lt;settings&amp;gt;      &lt;br /&gt;&amp;#160; &amp;lt;repositoryPath&amp;gt;..\Lib\&amp;lt;/repositoryPath&amp;gt;       &lt;br /&gt;&amp;lt;/settings&amp;gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;This structure might not be to your taste, but I like it as it means all projects are independent, and so is the build process. The downside is you have to manage the references for the projects and build separately, but I see this as good practice. You probably don’t share want to reference and Nuget packages between separate projects/solutions.&lt;/p&gt;  &lt;p&gt;So now we have a 2012 build process that can start Typemock Isolator, and a sample project that contains Typemock based tests, some using MSTest and some using XUnit (remember Visual Studio 2012 support multiple unit testing frameworks not just MSTest, &lt;a href="http://blogs.blackmarble.co.uk/blogs/rfennell/post/2012/03/27/Unit-testing-in-VS11Beta-and-getting-your-tests-to-run-on-the-new-TFSPreview-build-service.aspx"&gt;see here on how to set this up for TFS build&lt;/a&gt;). When the build is run I can see all my unit tests pass to Typemock isolator must be starting correctly&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.blackmarble.co.uk/blogs/rfennell/image.axd?picture=image_60.png"&gt;&lt;img title="image" style="border-left-width:0px;border-right-width:0px;border-bottom-width:0px;display:inline;border-top-width:0px;" border="0" alt="image" src="http://blogs.blackmarble.co.uk/blogs/rfennell/image.axd?picture=image_thumb_60.png" width="865" height="603" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;So for me this is a reasonable work around until Typemock ship a TFS 2012 specific version. &lt;a&gt;Hope this file saves you some time if you use Typemock and TFS 2012&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Links for todays Typemock webinar</title><link>http://msmvps.com/blogs/richardfennell/archive/2012/05/22/links-for-todays-typemock-webinar.aspx</link><pubDate>Tue, 22 May 2012 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1810099</guid><dc:creator>Anonymous</dc:creator><description>&lt;p&gt;Thanks to everyone who attended my Typemock Isolator and SharePoint session. The links I mentioned were&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://blogs.blackmarble.co.uk/blogs/rfennell/post/2010/04/22/mocking-sharepoint-for-design-with-typemock-isolator.aspx"&gt;Mocking Sharepoint for Design with Typemock Isolator&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.blackmarble.co.uk/blogs/rfennell/post/2011/09/06/update-on-using-typemock-isolator-to-allow-webpart-development-without-a-sharepoint-server.aspx"&gt;Mocking SP2010 64bit Assemblies with Typemock Isolator&lt;/a&gt;&amp;#160; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;I will post a link to the recording as soon as it is made available&lt;/p&gt;</description></item><item><title>Links for todays Typemock webinar</title><link>http://msmvps.com/blogs/rfennell/archive/2012/05/22/links-for-todays-typemock-webinar.aspx</link><pubDate>Tue, 22 May 2012 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1810102</guid><dc:creator>Anonymous</dc:creator><description>&lt;p&gt;Thanks to everyone who attended my Typemock Isolator and SharePoint session. The links I mentioned were&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://blogs.blackmarble.co.uk/blogs/rfennell/post/2010/04/22/mocking-sharepoint-for-design-with-typemock-isolator.aspx"&gt;Mocking Sharepoint for Design with Typemock Isolator&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.blackmarble.co.uk/blogs/rfennell/post/2011/09/06/update-on-using-typemock-isolator-to-allow-webpart-development-without-a-sharepoint-server.aspx"&gt;Mocking SP2010 64bit Assemblies with Typemock Isolator&lt;/a&gt;&amp;#160; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;I will post a link to the recording as soon as it is made available&lt;/p&gt;</description></item><item><title>Doing a webinar on Typemock Isolator and Sharepoint</title><link>http://msmvps.com/blogs/rfennell/archive/2012/05/10/doing-a-webinar-on-typemock-isolator-and-sharepoint.aspx</link><pubDate>Thu, 10 May 2012 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1809727</guid><dc:creator>Anonymous</dc:creator><description>&lt;p&gt;I am&amp;nbsp; presenting a webinar on Typemock Isolator and Sharepoint on the 22nd of May. &lt;a href="http://www.typemock.com/using-typemock-isolator-to-speed-up-sharepoint-development-may-webinar"&gt;For more details and to register see the Typemock site&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Doing a webinar on Typemock Isolator and Sharepoint</title><link>http://msmvps.com/blogs/richardfennell/archive/2012/05/10/doing-a-webinar-on-typemock-isolator-and-sharepoint.aspx</link><pubDate>Thu, 10 May 2012 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1809729</guid><dc:creator>Anonymous</dc:creator><description>&lt;p&gt;I am&amp;nbsp; presenting a webinar on Typemock Isolator and Sharepoint on the 22nd of May. &lt;a href="http://www.typemock.com/using-typemock-isolator-to-speed-up-sharepoint-development-may-webinar"&gt;For more details and to register see the Typemock site&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Fix for problem faking two SPLists in a single unit test with Typemock Isolator has been released</title><link>http://msmvps.com/blogs/richardfennell/archive/2012/04/02/fix-for-problem-faking-two-splists-in-a-single-unit-test-with-typemock-isolator-has-been-released.aspx</link><pubDate>Mon, 02 Apr 2012 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1808323</guid><dc:creator>Anonymous</dc:creator><description>&lt;p&gt;A &lt;a href="http://blogs.blackmarble.co.uk/blogs/rfennell/post/2010/09/10/problem-faking-multiple-splists-with-typemock-isolator-in-a-single-test.aspx"&gt;blogged a while ago about a problem faking multiple SPList with Typemock Isolator in a single test&lt;/a&gt;. With the release of &lt;a href="http://www.typemock.com/"&gt;Typemock Isolator 7.0.4.0&lt;/a&gt; you no longer have to use the workaround I documented. &lt;/p&gt;  &lt;p&gt;You can now use the code if the originally planned, and it works as expected&lt;/p&gt;  &lt;pre&gt;&lt;font size="1"&gt;   1: public partial class TestPage : System.Web.UI.Page&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;   2:  {&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;   3:     public TestPage()&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;   4:     {&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;   5:&amp;#160; var fakeWeb = Isolate.Fake.Instance&amp;lt;SPWeb&amp;gt;();&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;   7:        Isolate.WhenCalled(() =&amp;gt; SPControl.GetContextWeb(null)).WillReturn(fakeWeb);&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;   8:&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;   9:        // return value for 1st call&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  10:        Isolate.WhenCalled(() =&amp;gt; fakeWeb.Lists[&amp;quot;Centre Locations&amp;quot;].Items).WillReturnCollectionValuesOf(CreateCentreList());&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  11:        // return value for all other calls&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  12:        Isolate.WhenCalled(() =&amp;gt; fakeWeb.Lists[&amp;quot;Map Zoom Areas&amp;quot;].Items).WillReturnCollectionValuesOf(CreateZoomAreaList());&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  13:     }&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  14:&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  15:     private static List&amp;lt;SPListItem&amp;gt; CreateZoomAreaList()&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  16:     {&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  17:        var fakeZoomAreas = new List&amp;lt;SPListItem&amp;gt;();&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  18:        fakeZoomAreas.Add(CreateZoomAreaSPListItem(&amp;quot;London&amp;quot;, 51.49275, -0.137722222, 2, 14));&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  19:        return fakeZoomAreas;&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  20:     }&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  21:&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  22:     private static List&amp;lt;SPListItem&amp;gt; CreateCentreList()&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  23:     {&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  24:        var fakeSites = new List&amp;lt;SPListItem&amp;gt;();&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  25:        fakeSites.Add(CreateCentreSPListItem(&amp;quot;Aberdeen &amp;quot;, &amp;quot;1 The Road,  Aberdeen &amp;quot;, &amp;quot;Aberdeen@test.com&amp;quot;, &amp;quot;www.Aberdeen.test.com&amp;quot;, &amp;quot;1111&amp;quot;, &amp;quot;2222&amp;quot;, 57.13994444, -2.113333333));&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  26:        fakeSites.Add(CreateCentreSPListItem(&amp;quot;Altrincham &amp;quot;, &amp;quot;1 The Road,  Altrincham &amp;quot;, &amp;quot;Altrincham@test.com&amp;quot;, &amp;quot;www.Altrincham.test.com&amp;quot;, &amp;quot;3333&amp;quot;, &amp;quot;4444&amp;quot;, 53.38977778, -2.349916667));&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  27:        return fakeSites;&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  28:     }&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  29:&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  30:     private static SPListItem CreateCentreSPListItem(string title, string address, string email, string url, string telephone, string fax, double lat, double lng)&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  31:     {&lt;/font&gt;&lt;font size="1"&gt;  &lt;br /&gt;  32:         var fakeItem = Isolate.Fake.Instance&amp;lt;SPListItem&amp;gt;();&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  33:         Isolate.WhenCalled(() =&amp;gt; fakeItem[&amp;quot;Title&amp;quot;]).WillReturn(title);&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  34:         Isolate.WhenCalled(() =&amp;gt; fakeItem[&amp;quot;Address&amp;quot;]).WillReturn(address);&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  35:         Isolate.WhenCalled(() =&amp;gt; fakeItem[&amp;quot;Email Address&amp;quot;]).WillReturn(email);&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  36:         Isolate.WhenCalled(() =&amp;gt; fakeItem[&amp;quot;Site URL&amp;quot;]).WillReturn(url);&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  37:         Isolate.WhenCalled(() =&amp;gt; fakeItem[&amp;quot;Telephone&amp;quot;]).WillReturn(telephone);&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  38:         Isolate.WhenCalled(() =&amp;gt; fakeItem[&amp;quot;Fax&amp;quot;]).WillReturn(fax);&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  39:         Isolate.WhenCalled(() =&amp;gt; fakeItem[&amp;quot;Latitude&amp;quot;]).WillReturn(lat.ToString());&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  40:         Isolate.WhenCalled(() =&amp;gt; fakeItem[&amp;quot;Longitude&amp;quot;]).WillReturn(lng.ToString());&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  41:         return fakeItem;&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  42:     }&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  43:&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  44:     private static SPListItem CreateZoomAreaSPListItem(string areaName, double lat, double lng, double radius, int zoom)&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  45:     {&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  46:         var fakeItem = Isolate.Fake.Instance&amp;lt;SPListItem&amp;gt;();&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  47:         Isolate.WhenCalled(() =&amp;gt; fakeItem[&amp;quot;Title&amp;quot;]).WillReturn(areaName);&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  48:         Isolate.WhenCalled(() =&amp;gt; fakeItem[&amp;quot;Latitude&amp;quot;]).WillReturn(lat.ToString());&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  49:         Isolate.WhenCalled(() =&amp;gt; fakeItem[&amp;quot;Longitude&amp;quot;]).WillReturn(lng.ToString());&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  50:         Isolate.WhenCalled(() =&amp;gt; fakeItem[&amp;quot;Radius&amp;quot;]).WillReturn(radius.ToString());&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  51:         Isolate.WhenCalled(() =&amp;gt; fakeItem[&amp;quot;Zoom&amp;quot;]).WillReturn(zoom.ToString());&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  52:         return fakeItem;&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  53:     }&lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  54:&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font size="1"&gt;  55: }&lt;/font&gt;&lt;/pre&gt;

&lt;p&gt;&lt;font size="1"&gt;&lt;/font&gt; A check of the returned values shows&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;web.Lists[&amp;quot;Centre Locations&amp;quot;].Items.Count returns 2&lt;/font&gt; &lt;/li&gt;

  &lt;li&gt;&lt;font size="2" face="Calibri"&gt;web.Lists[&amp;quot;Map Zoom Areas&amp;quot;].Items.Count) returns 1&lt;/font&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt;</description></item></channel></rss>