<?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 'VSTS'</title><link>http://msmvps.com/search/SearchResults.aspx?q=app:weblogs&amp;tag=VSTS&amp;orTags=0&amp;o=DateDescending</link><description>Search results for 'app:weblogs' matching tag 'VSTS'</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>Experiences upgrading our TFS2012RC to RTM</title><link>http://msmvps.com/blogs/richardfennell/archive/2012/08/20/experiences-upgrading-our-tfs2012rc-to-rtm.aspx</link><pubDate>Mon, 20 Aug 2012 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1815307</guid><dc:creator>Anonymous</dc:creator><description>&lt;p&gt;We have just completed the upgraded of our TFS2012 server from RC to RTM. All went smoothly, just a few comments worth mentioning&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The install of TFS2012 (after the removal of the RC) required three reboots, 2 for C++ components and one for .NET 4.5. So&amp;nbsp; if seeing reboots don&amp;rsquo;t worry too much.&lt;/li&gt;
&lt;li&gt;When running the upgrade wizard we got a verify warning over port 443 already being used (we had manually configured via IIS manager for our server to use 8080 and 443). We ignored this warning. However after the upgrade wizard had completed, with no errors, we found that the new web server could not start. Turns out it it had been left bound as HTTP to Port 443, so it was very confused. We just deleted this binding and re-added HTTP on 8080 and HTTPS on 433 with our wildcard certificate and it was fine. So in hindsight we should have headed the warning and removed our custom bindings.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So now off to the long job of upgrading build box, test controller and the rest.&lt;/p&gt;</description></item><item><title>Experiences upgrading our TFS2012RC to RTM</title><link>http://msmvps.com/blogs/rfennell/archive/2012/08/20/experiences-upgrading-our-tfs2012rc-to-rtm.aspx</link><pubDate>Mon, 20 Aug 2012 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1815306</guid><dc:creator>Anonymous</dc:creator><description>&lt;p&gt;We have just completed the upgraded of our TFS2012 server from RC to RTM. All went smoothly, just a few comments worth mentioning&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The install of TFS2012 (after the removal of the RC) required three reboots, 2 for C++ components and one for .NET 4.5. So&amp;nbsp; if seeing reboots don&amp;rsquo;t worry too much.&lt;/li&gt;
&lt;li&gt;When running the upgrade wizard we got a verify warning over port 443 already being used (we had manually configured via IIS manager for our server to use 8080 and 443). We ignored this warning. However after the upgrade wizard had completed, with no errors, we found that the new web server could not start. Turns out it it had been left bound as HTTP to Port 443, so it was very confused. We just deleted this binding and re-added HTTP on 8080 and HTTPS on 433 with our wildcard certificate and it was fine. So in hindsight we should have headed the warning and removed our custom bindings.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So now off to the long job of upgrading build box, test controller and the rest.&lt;/p&gt;</description></item><item><title>TF900546 error on a TFS 2012 build</title><link>http://msmvps.com/blogs/richardfennell/archive/2012/08/09/tf900546-error-on-a-tfs-2012-build.aspx</link><pubDate>Thu, 09 Aug 2012 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1814932</guid><dc:creator>Anonymous</dc:creator><description>&lt;p&gt;Whilst moving over to our new TFS 2012 installation I got the following error when a build tried to run tests&lt;/p&gt;  &lt;p&gt;&lt;em&gt;TF900546: An unexpected error occurred while running the RunTests activity: &amp;#39;Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.&amp;#39;.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;This was a new one on me, and nothing of much use on the web other than a &lt;a href="http://msdn.microsoft.com/en-us/library/tfs/microsoft.teamfoundation.build.workflow.activities.activitiesresources.unexpectedagiletestplatformexception(v=vs.110).aspx"&gt;basic MSDN page&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Turns out the immediate fix is to just restart the build controller. Initially I did this after switching to the default build process template, and setting it to NOT load any custom activities, but I seems a simple restart would have been enough as once I re-enabled all custom activities it still worked.&lt;/p&gt;  &lt;p&gt;As to the root cause I have no idea, one to keep an eye on, especially as I am currently on the RC, lets see what the RTM build does.&lt;/p&gt;</description></item><item><title>TF900546 error on a TFS 2012 build</title><link>http://msmvps.com/blogs/rfennell/archive/2012/08/09/tf900546-error-on-a-tfs-2012-build.aspx</link><pubDate>Thu, 09 Aug 2012 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1814931</guid><dc:creator>Anonymous</dc:creator><description>&lt;p&gt;Whilst moving over to our new TFS 2012 installation I got the following error when a build tried to run tests&lt;/p&gt;  &lt;p&gt;&lt;em&gt;TF900546: An unexpected error occurred while running the RunTests activity: &amp;#39;Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.&amp;#39;.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;This was a new one on me, and nothing of much use on the web other than a &lt;a href="http://msdn.microsoft.com/en-us/library/tfs/microsoft.teamfoundation.build.workflow.activities.activitiesresources.unexpectedagiletestplatformexception(v=vs.110).aspx"&gt;basic MSDN page&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Turns out the immediate fix is to just restart the build controller. Initially I did this after switching to the default build process template, and setting it to NOT load any custom activities, but I seems a simple restart would have been enough as once I re-enabled all custom activities it still worked.&lt;/p&gt;  &lt;p&gt;As to the root cause I have no idea, one to keep an eye on, especially as I am currently on the RC, lets see what the RTM build does.&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>Two problems editing TFS2012 build workflows with the same solution</title><link>http://msmvps.com/blogs/richardfennell/archive/2012/07/30/two-problems-editing-tfs2012-build-workflows-with-the-same-solution.aspx</link><pubDate>Mon, 30 Jul 2012 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1813916</guid><dc:creator>Anonymous</dc:creator><description>&lt;p&gt;Whilst moving over to our new TFS2012 system I have been editing build templates, pulling the best bits from the selection of templates we used in 2010 into one master build process to be used for most future projects. Doing this I have hit a couple of problems, turns out the cure is the same for both&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Problem 1 : When adding custom activities to the toolbox Visual Studio crashes&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://tfsbuildextensions.codeplex.com/wikipage?title=How%20to%20integrate%20the%20extensions%20into%20a%20build%20template&amp;amp;referringTitle=Documentation"&gt;See the community activities documentation for the process to add a items to the toolbox&lt;/a&gt;, when you get to step to browse for the custom assembly you get a crash.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.blackmarble.co.uk/blogs/rfennell/image.axd?picture=clip_image002_1.jpg"&gt;&lt;img title="clip_image002" style="border-top:0px;border-right:0px;border-bottom:0px;border-left:0px;display:inline;" border="0" alt="clip_image002" src="http://blogs.blackmarble.co.uk/blogs/rfennell/image.axd?picture=clip_image002_thumb_1.jpg" width="466" height="335" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Problem 2: When editing a process template in any way the process is corrupted and the build fails&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;When the build runs you get the error (amongst others)&lt;/p&gt;  &lt;p&gt;&lt;em&gt;The build process failed validation. Details:      &lt;br /&gt;Validation Error: The private implementation of activity &amp;#39;1: DynamicActivity&amp;#39; has the following validation error:&amp;#160;&amp;#160; Compiler error(s) encountered processing expression &amp;quot;BuildDetail.BuildNumber&amp;quot;.      &lt;br /&gt;Type &amp;#39;IBuildDetail&amp;#39; is not defined.&lt;/em&gt;&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_55.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_55.png" width="624" height="291" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;The Solution&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Turns out the issue that caused both these problems was that the Visual Studio class library project I was using to host the XAML workflow for editing was targeting .NET 4.5, the default for VS2012. I changed the project to target .NET 4.0, rolled back the XAML file back to an unedited version and reapplied my changes and all was OK.&lt;/p&gt;  &lt;p&gt;Yes I know it is strange, as you never build the containing project, but the targeted .NET version is passed around VS for building lists and the like, hence the problem.&lt;/p&gt;</description></item><item><title>Two problems editing TFS2012 build workflows with the same solution</title><link>http://msmvps.com/blogs/rfennell/archive/2012/07/30/two-problems-editing-tfs2012-build-workflows-with-the-same-solution.aspx</link><pubDate>Mon, 30 Jul 2012 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1813915</guid><dc:creator>Anonymous</dc:creator><description>&lt;p&gt;Whilst moving over to our new TFS2012 system I have been editing build templates, pulling the best bits from the selection of templates we used in 2010 into one master build process to be used for most future projects. Doing this I have hit a couple of problems, turns out the cure is the same for both&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Problem 1 : When adding custom activities to the toolbox Visual Studio crashes&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://tfsbuildextensions.codeplex.com/wikipage?title=How%20to%20integrate%20the%20extensions%20into%20a%20build%20template&amp;amp;referringTitle=Documentation"&gt;See the community activities documentation for the process to add a items to the toolbox&lt;/a&gt;, when you get to step to browse for the custom assembly you get a crash.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.blackmarble.co.uk/blogs/rfennell/image.axd?picture=clip_image002_1.jpg"&gt;&lt;img title="clip_image002" style="border-top:0px;border-right:0px;border-bottom:0px;border-left:0px;display:inline;" border="0" alt="clip_image002" src="http://blogs.blackmarble.co.uk/blogs/rfennell/image.axd?picture=clip_image002_thumb_1.jpg" width="466" height="335" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Problem 2: When editing a process template in any way the process is corrupted and the build fails&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;When the build runs you get the error (amongst others)&lt;/p&gt;  &lt;p&gt;&lt;em&gt;The build process failed validation. Details:      &lt;br /&gt;Validation Error: The private implementation of activity &amp;#39;1: DynamicActivity&amp;#39; has the following validation error:&amp;#160;&amp;#160; Compiler error(s) encountered processing expression &amp;quot;BuildDetail.BuildNumber&amp;quot;.      &lt;br /&gt;Type &amp;#39;IBuildDetail&amp;#39; is not defined.&lt;/em&gt;&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_55.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_55.png" width="624" height="291" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;The Solution&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Turns out the issue that caused both these problems was that the Visual Studio class library project I was using to host the XAML workflow for editing was targeting .NET 4.5, the default for VS2012. I changed the project to target .NET 4.0, rolled back the XAML file back to an unedited version and reapplied my changes and all was OK.&lt;/p&gt;  &lt;p&gt;Yes I know it is strange, as you never build the containing project, but the targeted .NET version is passed around VS for building lists and the like, hence the problem.&lt;/p&gt;</description></item></channel></rss>