<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Marcel de Vries, MVP Team System </title><link>http://blogs.infosupport.com/blogs/marcelv/default.aspx</link><description>.NET Technologies, Architecture and Web Development</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Marcelv" /><feedburner:info uri="marcelv" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><title>Creating an VS2010 add-in to show the running user as part of the main IDE window title</title><link>http://feedproxy.google.com/~r/Marcelv/~3/oeJOfFQylIo/creating-an-vs2010-add-in-to-show-the-running-user-as-part-of-the-main-ide-window-title.aspx</link><pubDate>Tue, 22 Jun 2010 21:40:00 GMT</pubDate><guid isPermaLink="false">56f6167b-0c51-4839-ab2d-34653eeb5c9c:202505</guid><dc:creator>marcelv</dc:creator><slash:comments>1</slash:comments><wfw:commentRss>http://blogs.infosupport.com/blogs/marcelv/rsscomments.aspx?PostID=202505</wfw:commentRss><comments>http://blogs.infosupport.com/blogs/marcelv/archive/2010/06/22/creating-an-vs2010-add-in-to-show-the-running-user-as-part-of-the-main-ide-window-title.aspx#comments</comments><description>&lt;p&gt;Today some of my fellow MVP&amp;rsquo;s asked the question if there is an option in Visual Studio to show under which user account the IDE is running.&lt;/p&gt;
&lt;p&gt;the need this feature since they do a lot of demonstrations on using the IDE and then use the runas option, to show how you e.g. can work with multiple users on a piece of code using version control etc.&lt;/p&gt;
&lt;p&gt;Unfortunately this is something not default possible with the VS IDE.&lt;/p&gt;
&lt;p&gt;But after doing some visual Studio Integration work in the past I thought this should not be to hard to build myself.&lt;/p&gt;
&lt;p&gt;On the first thought I would just try to create an Visual Studio Add-in and there try to obtain a reference to the main window and there set the caption. Unfortunately that would have been too easy :-D. It is not possible this way , since the property on the main window is read-only and when you try to set it you will get an error message.&lt;/p&gt;
&lt;p&gt;But hey, you probably also remember the good old days where we had the Win32 API as our friend. In win32 you can set the windows caption of a window using a wind32 API call called SendMessage as long as you provide the correct parameters. So I thought to give that Idea a shot. &lt;/p&gt;
&lt;p&gt;To make that work I did following:&lt;/p&gt;
&lt;p&gt;On the Add In connect, get a reference to the Main Window. From the Main window, get the native windows handle (Hwnd)&lt;/p&gt;
&lt;p&gt;Then use good old PInvoke to call an imported win32 API SendMessage and send a WM_SETTEXT message to the main window.&lt;/p&gt;
&lt;p&gt;Now the last thing to fix, is that each and every time a window is opened or changed, the caption will disappear. To fix this, I just subscribed to two main events, WindowActivated and WindowCreated and there execute the same code again. this way the caption is always updated once a new window is opened or closed.&lt;/p&gt;
&lt;p&gt;The following code does the trick:&lt;/p&gt;
&lt;pre style="font-family:consolas;"&gt;[&lt;span style="color:#2b91af;"&gt;DllImport&lt;/span&gt;(&lt;span style="color:#a31515;"&gt;&amp;quot;user32.dll&amp;quot;&lt;/span&gt;, CharSet = &lt;span style="color:#2b91af;"&gt;CharSet&lt;/span&gt;.Auto)]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;static&lt;/span&gt;&amp;nbsp;&lt;span style="color:blue;"&gt;extern&lt;/span&gt;&amp;nbsp;&lt;span style="color:#2b91af;"&gt;IntPtr&lt;/span&gt; SendMessage(&lt;span style="color:#2b91af;"&gt;IntPtr&lt;/span&gt; hWnd, &lt;span style="color:#2b91af;"&gt;UInt32&lt;/span&gt; Msg, &lt;span style="color:#2b91af;"&gt;IntPtr&lt;/span&gt; wParam, &lt;span style="color:blue;"&gt;string&lt;/span&gt; lParam);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color:blue;"&gt;const&lt;/span&gt;&amp;nbsp;&lt;span style="color:#2b91af;"&gt;UInt32&lt;/span&gt; WM_SETTEXT = 0x000C;&lt;br /&gt;&lt;/pre&gt;
&lt;pre style="font-family:consolas;"&gt;&lt;span style="color:blue;"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color:blue;"&gt;void&lt;/span&gt; OnConnection(&lt;span style="color:blue;"&gt;object&lt;/span&gt; application, &lt;span style="color:#2b91af;"&gt;ext_ConnectMode&lt;/span&gt; connectMode, &lt;span style="color:blue;"&gt;object&lt;/span&gt; addInInst, &lt;span style="color:blue;"&gt;ref&lt;/span&gt;&amp;nbsp;&lt;span style="color:#2b91af;"&gt;Array&lt;/span&gt; custom)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; _applicationObject = (&lt;span style="color:#2b91af;"&gt;DTE2&lt;/span&gt;)application;&lt;br /&gt;&amp;nbsp;&amp;nbsp; _addInInstance = (&lt;span style="color:#2b91af;"&gt;AddIn&lt;/span&gt;)addInInst;&lt;/pre&gt;
&lt;pre style="font-family:consolas;"&gt;}&lt;/pre&gt;
&lt;pre style="font-family:consolas;"&gt;&lt;span style="color:blue;"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color:blue;"&gt;void&lt;/span&gt; OnStartupComplete(&lt;span style="color:blue;"&gt;ref&lt;/span&gt;&amp;nbsp;&lt;span style="color:#2b91af;"&gt;Array&lt;/span&gt; custom)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; _applicationObject.Events.WindowEvents.WindowActivated += &lt;span style="color:blue;"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color:#2b91af;"&gt;_dispWindowEvents_WindowActivatedEventHandler&lt;/span&gt;(WindowEvents_WindowActivated);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; _applicationObject.Events.WindowEvents.WindowCreated += &lt;span style="color:blue;"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color:#2b91af;"&gt;_dispWindowEvents_WindowCreatedEventHandler&lt;/span&gt;(WindowEvents_WindowCreated);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WindowEvents_WindowActivated(&lt;span style="color:blue;"&gt;null&lt;/span&gt;, &lt;span style="color:blue;"&gt;null&lt;/span&gt;);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;
&lt;pre style="font-family:consolas;"&gt;&lt;span style="color:blue;"&gt;void&lt;/span&gt; WindowEvents_WindowCreated(&lt;span style="color:#2b91af;"&gt;Window&lt;/span&gt; Window)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WindowEvents_WindowActivated(&lt;span style="color:blue;"&gt;null&lt;/span&gt;, &lt;span style="color:blue;"&gt;null&lt;/span&gt;);&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;&lt;span style="color:blue;"&gt;void&lt;/span&gt; WindowEvents_WindowActivated(&lt;span style="color:#2b91af;"&gt;Window&lt;/span&gt; GotFocus, &lt;span style="color:#2b91af;"&gt;Window&lt;/span&gt; LostFocus)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#2b91af;"&gt;DTE&lt;/span&gt; d = _applicationObject &lt;span style="color:blue;"&gt;as&lt;/span&gt;&amp;nbsp;&lt;span style="color:#2b91af;"&gt;DTE&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#2b91af;"&gt;IntPtr&lt;/span&gt; hWnd = &lt;span style="color:blue;"&gt;new&lt;/span&gt; System.&lt;span style="color:#2b91af;"&gt;IntPtr&lt;/span&gt;(d.MainWindow.HWnd);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;string&lt;/span&gt; Caption = d.MainWindow.Caption + &lt;span style="color:#a31515;"&gt;&amp;quot;*** &amp;quot;&lt;/span&gt; + System.Threading.&lt;span style="color:#2b91af;"&gt;Thread&lt;/span&gt;.CurrentPrincipal.Identity.Name + &lt;span style="color:#a31515;"&gt;&amp;quot; ****&amp;quot;&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#2b91af;"&gt;Connect&lt;/span&gt;.SendMessage(hWnd, WM_SETTEXT, &lt;span style="color:blue;"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color:#2b91af;"&gt;IntPtr&lt;/span&gt;(0), Caption);&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;As you can see, the following is the result when you activate the add-in:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/image_5F00_717F3010.png"&gt;&lt;img height="488" width="683" src="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/image_5F00_thumb_5F00_0A9A8A49.png" alt="image" border="0" title="image" style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Here you can find the sources as a downloadable Zip(&lt;a href="http://blogs.infosupport.com/media/p/202504.aspx" title="http://blogs.infosupport.com/media/p/202504.aspx"&gt;http://blogs.infosupport.com/media/p/202504.aspx&lt;/a&gt;), I did not create an installer for it, just open the zip, compile it and activate the registered Add-in.&lt;/p&gt;
&lt;p&gt;voila :-)&lt;/p&gt;
&lt;p&gt;Cheers&lt;/p&gt;
&lt;p&gt;Marcel&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.infosupport.com/aggbug.aspx?PostID=202505" width="1" height="1"&gt;</description><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/Team+System+Extensibility/default.aspx">Team System Extensibility</category><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/MVP/default.aspx">MVP</category><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/Regional+Director/default.aspx">Regional Director</category><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/Visual+Studio+2010/default.aspx">Visual Studio 2010</category><feedburner:origLink>http://blogs.infosupport.com/blogs/marcelv/archive/2010/06/22/creating-an-vs2010-add-in-to-show-the-running-user-as-part-of-the-main-ide-window-title.aspx</feedburner:origLink></item><item><title>The how and why behind TF203015: &lt;file&gt; has an incompatible change, while unshelving a shelve set</title><link>http://feedproxy.google.com/~r/Marcelv/~3/tJJXKEuWB0w/the-how-and-why-behind-tf203015-lt-file-gt-has-an-incompatible-change-while-unshelving-a-shelve-set.aspx</link><pubDate>Fri, 11 Jun 2010 19:06:56 GMT</pubDate><guid isPermaLink="false">56f6167b-0c51-4839-ab2d-34653eeb5c9c:202464</guid><dc:creator>marcelv</dc:creator><slash:comments>1</slash:comments><wfw:commentRss>http://blogs.infosupport.com/blogs/marcelv/rsscomments.aspx?PostID=202464</wfw:commentRss><comments>http://blogs.infosupport.com/blogs/marcelv/archive/2010/06/11/the-how-and-why-behind-tf203015-lt-file-gt-has-an-incompatible-change-while-unshelving-a-shelve-set.aspx#comments</comments><description>&lt;p&gt;Today one of our developers wanted to unshelve a shelve set he created earlier that morning and got the error message TF203015.&lt;/p&gt;  &lt;p&gt;I must say I also was quite confused about what an “incompatible change” would be and why it could not unshelve the files for me. What can be incompatible? Is the file corrupted, other encoding,…?!? At first I thought this might have been caused by the fact that this developer was running Visual studio 2008 + TFS 2010 compatibility GDR against our upgraded 2010 TFS server. Since many internal changes where made in the 2010 release I feared something had gone wrong with the shelve set on the server.&lt;/p&gt;  &lt;p&gt;So I I tried to unshelve the shelve set he created. And that just went fine. So why did he get the message and I didn’t ?&lt;/p&gt;  &lt;p&gt;So what do you do, you search the internet for this error, but at this point there is not that much to find about this issue. So I luckily could ask the question at the always helpful TFS champs. And they immediately asked me if my developer already had a pending change on the sources he wanted to unshelve in his workspace. And yes that was exactly the case. So why would a pending change in the same workspace create an incompatible change you might ask yourself? Normally you would just resolve this with a merge conflict dialog you might think.&lt;/p&gt;  &lt;p&gt;That is correct. It appears that merging of conflicting changes that come from shelve sets is still a thing to build by the TFS team and is still on the product backlog. So when you have conflicting changes in the shelve set, you just can’t unshelve anymore. And this has been around since 2005, so nothing new in this release.&lt;/p&gt;  &lt;p&gt;So to give you an idea about the scenario, this is how to reproduce the issue:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Edit a file a.cs &lt;/li&gt;    &lt;li&gt;Create a shelve set and name it “test” that contains the change &lt;/li&gt;    &lt;li&gt;Now create a new workspace (you can omit this step and progress in the same workspace, but it seemed less obvious to me this also is an issue with another workspace) &lt;/li&gt;    &lt;li&gt;Edit the file a.cs again and change something that normally would be easy to merge (add a line of comment to another function or something similar) &lt;/li&gt;    &lt;li&gt;At this point try to unshelve shelve set “test” &lt;/li&gt;    &lt;li&gt;You will now get the following error: TF203015: The item $/&amp;lt;teamproject&amp;gt;/main/solution/project/a.cs has an incompatible pending change &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;So whenever you run into this issue, take a look at the output window of Visual studio and switch it to the “Source Control – Team Foundation Server”. there you will find the details about the file that has an incompatible change. And incompatible, just means it has a merge conflict with the current workspace and VSTS has no support yet for you to show you the merge resolution screen for this issue. so what to do when you run into this issue and you want to keep the changes in your local workspace?&lt;/p&gt;  &lt;p&gt;Well just create an empty workspace and unshelve there, no conflicting changes, so it will unshelve fine there. then merge by hand using your favorite merge tool.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;em&gt;[Edit 13/06/2010]&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;As an alternative you can also use the power tools that includes the command tfpt unshelve.(&lt;a title="http://msdn.microsoft.com/en-us/vstudio/bb980963.aspx" href="http://msdn.microsoft.com/en-us/vstudio/bb980963.aspx"&gt;http://msdn.microsoft.com/en-us/vstudio/bb980963.aspx&lt;/a&gt;) Then you can get the conflict resolution screen to apear and you are able to merge the file as you would have expected.&lt;/p&gt;  &lt;p&gt;this looks as follows:&lt;/p&gt;  &lt;p&gt;(assuming a working folder = d:\temp\test\TipCalculator\TipCalculator)&lt;/p&gt;  &lt;p&gt;Open a visual Studio command prompt&lt;/p&gt;  &lt;p&gt;Enter the following command: tfpt unshelve&lt;/p&gt;  &lt;p&gt;For my server this shows the following dialog:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/image_5F00_01B0EC15.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/image_5F00_thumb_5F00_00D8862B.png" width="423" height="330" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now I select the shelveset test 1 again and get the following dialog:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/image_5F00_4E087FB6.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/image_5F00_thumb_5F00_6D4B2689.png" width="593" height="269" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;So now I can select my file and then get the conflict resolution dialog:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/image_5F00_7391FD17.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/image_5F00_thumb_5F00_44CC4475.png" width="600" height="218" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;this now gives me the option to do the merge and voila, it unsheleved :-)&lt;/p&gt;  &lt;p&gt;So when you run into this issue again, you know the power tools are your friend.&lt;/p&gt;  &lt;p&gt;Hope this helps,&lt;/p&gt;  &lt;p&gt;Cheers,&lt;/p&gt;  &lt;p&gt;Marcel&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.infosupport.com/aggbug.aspx?PostID=202464" width="1" height="1"&gt;</description><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/Team+System/default.aspx">Team System</category><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/MVP/default.aspx">MVP</category><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/Team+Foundation+Server/default.aspx">Team Foundation Server</category><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/Regional+Director/default.aspx">Regional Director</category><feedburner:origLink>http://blogs.infosupport.com/blogs/marcelv/archive/2010/06/11/the-how-and-why-behind-tf203015-lt-file-gt-has-an-incompatible-change-while-unshelving-a-shelve-set.aspx</feedburner:origLink></item><item><title>WF persistence ownershipTimeout and multiple runtime instances, how to avoid scheduling of the the same workflow instance</title><link>http://feedproxy.google.com/~r/Marcelv/~3/BrcVoxmWlqE/wf-persistence-ownershiptimeout-and-multiple-runtime-instances-how-to-avoid-scheduling-of-the-the-same-workflow-instance.aspx</link><pubDate>Mon, 07 Jun 2010 20:36:20 GMT</pubDate><guid isPermaLink="false">56f6167b-0c51-4839-ab2d-34653eeb5c9c:202452</guid><dc:creator>marcelv</dc:creator><slash:comments>1</slash:comments><wfw:commentRss>http://blogs.infosupport.com/blogs/marcelv/rsscomments.aspx?PostID=202452</wfw:commentRss><comments>http://blogs.infosupport.com/blogs/marcelv/archive/2010/06/07/wf-persistence-ownershiptimeout-and-multiple-runtime-instances-how-to-avoid-scheduling-of-the-the-same-workflow-instance.aspx#comments</comments><description>&lt;p&gt;In one of the projects I work for as an architect we ran into an interesting issue related to WF and WCF messages we receive. We discovered that each time we started our workflow host again, we would see the same workflow instance scheduled twice in different workflow runtimes. We discovered this had to do with persistence points we injected to ensure messages would be processed. So what we had is basically the following workflow:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/image_5F00_298D15B4.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:block;float:none;margin-left:auto;border-top:0px;margin-right:auto;border-right:0px;" title="image" border="0" alt="image" src="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/image_5F00_thumb_5F00_16A86C3D.png" width="794" height="559" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;We have external messages coming in from the outer word, then we ensure the message is persisted in the workflow and then we call an other internal web service that handles part of the process. Now what is interesting about this construct is that when you first run this for the first time you see the following behavior:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;AppDomain.CurrentDomain.FriendlyName &lt;/strong&gt;: &lt;strong&gt;Workflow Instance ID&lt;/strong&gt; : &lt;strong&gt;Message&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;8dc76321-1-129203865283528469: 6271b6f5-962c-41fa-877e-e74f8f74b511: Workflow1:1   &lt;br /&gt;8dc76321-1-129203865283528469: 6271b6f5-962c-41fa-877e-e74f8f74b511: Workflow1:2    &lt;br /&gt;&lt;strong&gt;&lt;font color="#ff0000"&gt;8dc76321-1-129203865283528469: 6271b6f5-962c-41fa-877e-e74f8f74b511: Workflow1:1&lt;/font&gt;&lt;/strong&gt;    &lt;br /&gt;8dc76321-1-129203865283528469: 1f5d7117-86bc-43d0-bc30-eb9c6b006b38: Workflow2:1    &lt;br /&gt;8dc76321-1-129203865283528469: 6271b6f5-962c-41fa-877e-e74f8f74b511: Workflow1:3&lt;/p&gt;  &lt;p&gt;Now at first this looks like a bug, but it get’s more interesting if you dive into the behavior of windows workflow and the way they handle incoming message receive activities. What happens is that when you receive an incoming message, the receive activity activates the workflow type it is part of. Because we enforced persistence within the sequence, a persistence record will be in the persistence store. Now when I receive the second message the WF infrastructure initiates a new windows workflow runtime for the new type of workflow “Workflow type 2”. Because a new workflow runtime is started, also persistence is initialized and there it will look for any instance that is in the state running and has no ownership, so the runtime can pick up that instance and re-start it. &lt;/p&gt;  &lt;p&gt;So lets first start with showing the configuration I used for the service behavior:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/image_5F00_475B73E8.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:block;float:none;margin-left:auto;border-top:0px;margin-right:auto;border-right:0px;" title="image" border="0" alt="image" src="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/image_5F00_thumb_5F00_34A67A31.png" width="822" height="281" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;So what happens when you use this “default” configuration of the persistence services?    &lt;br /&gt;Both services will use the same persistence store and don’t claim ownership of an instance while they run. The reason for this is that the workflow runtime does not want to incur a locking performance penalty when one workflow runtime uses one store. Mainly in a farm scenario you would need a configuration where the persistence store is multiple workflow runtime instances aware and uses a locking mechanism. The SqlworkflowPersistence class,that is responsible for the persistence implementation has multiple constructors that will initiate different behavior. When you configure the persistence using configuration as shown, you will use the constructor that initiates a non locking version of the persistence service. The way to create an instance that is locking aware, you need to configure a property &lt;em&gt;OwnershipTimeoutSeconds.&lt;/em&gt; This interval specifies how long the ownership of a workflow runtime is honored and when the lock should be treated as “ignore the lock, the instance probably died” and pick up this instance and schedule it for execution. &lt;/p&gt;  &lt;p&gt;Once you set this property, the calls to the stored procedures are different in such a way that each runtime instance will have it’s own instance ID. This ID is used for locking.&lt;/p&gt;  &lt;p&gt;So the configuration for a workflow service hosted in IIS would look as follows:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/image_5F00_4CC9E48C.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:block;float:none;margin-left:auto;border-top:0px;margin-right:auto;border-right:0px;" title="image" border="0" alt="image" src="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/image_5F00_thumb_5F00_6C0C8B5F.png" width="807" height="279" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;One thing I was not aware of is that for each workflow type there initiates a new workflow runtime instance and therefore will cause this problem when you have multiple workflow services in the same workflow hosting environment. So for our two workflow types in the described scenario there will be two instances of the workflow runtime. &lt;/p&gt;  &lt;p&gt;Now the only remaining question is, what value should I specify for the &lt;strong&gt;&lt;em&gt;OwnershipTimeoutSeconds&lt;/em&gt;&lt;/strong&gt;?     &lt;br /&gt;The value must be big enough to allow a workflow instance episode (from idle to running, back to idle and persisted again) to fully execute. If the ownership is to short, you will experience multiple instances of the same workflow executing in different workflow runtime instances. (like the issue we had) The maximum value for this property is the time you think is allowed between a failing workflow to get picked up by another workflow runtime. For my sample workflows in this post 10 seconds is more then enough, but in more complex scenario’s you need to figure out the maximum time spend and e.g. the recovery time allowed with your non functional requirements. One thing to discover the minimum value, would be to plug in the tracking services as well and track the time spend between WorkflowTrack events of type Persisted. this way you can see the intervals between persistence and determine the minimum interval that needs to be set to a value higher then the maximum value found.&lt;/p&gt;  &lt;p&gt;Hope this helps when you run into the same issue.   &lt;br /&gt;Cheers,&lt;/p&gt;  &lt;p&gt;Marcel&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.infosupport.com/aggbug.aspx?PostID=202452" width="1" height="1"&gt;</description><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/Windows+Workflow+Foundation/default.aspx">Windows Workflow Foundation</category><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/MVP/default.aspx">MVP</category><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/Regional+Director/default.aspx">Regional Director</category><feedburner:origLink>http://blogs.infosupport.com/blogs/marcelv/archive/2010/06/07/wf-persistence-ownershiptimeout-and-multiple-runtime-instances-how-to-avoid-scheduling-of-the-the-same-workflow-instance.aspx</feedburner:origLink></item><item><title>TFS 2010 TF261007 error message when attaching a collection</title><link>http://feedproxy.google.com/~r/Marcelv/~3/S5py5Ao54rc/tfs-2010-tf261007-error-message-when-attaching-a-collection.aspx</link><pubDate>Fri, 19 Mar 2010 13:32:00 GMT</pubDate><guid isPermaLink="false">56f6167b-0c51-4839-ab2d-34653eeb5c9c:201859</guid><dc:creator>marcelv</dc:creator><slash:comments>2</slash:comments><wfw:commentRss>http://blogs.infosupport.com/blogs/marcelv/rsscomments.aspx?PostID=201859</wfw:commentRss><comments>http://blogs.infosupport.com/blogs/marcelv/archive/2010/03/19/tfs-2010-tf261007-error-message-when-attaching-a-collection.aspx#comments</comments><description>&lt;p&gt;Today I tried to move a TFS collection from one server to another server.&lt;/p&gt;  &lt;p&gt;I followed the steps as described in detail at the &lt;a href="http://msdn.microsoft.com/en-us/library/dd936138(VS.100).aspx" target="_blank"&gt;following location&lt;/a&gt;. But Unfortunately I forgot to remove the lab management resources.&lt;/p&gt;  &lt;p&gt;Since my new server does not have the lab management environment set up at this moment and my old machine did this is where I hit a problem during the restore of the collection at the new server.&lt;/p&gt;  &lt;p&gt;I got the following error:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/clip_5F00_image002_5F00_27DB739A.jpg"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="clip_image002" border="0" alt="clip_image002" src="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/clip_5F00_image002_5F00_thumb_5F00_152679E3.jpg" width="486" height="331" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#ff0000" size="2"&gt;&lt;em&gt;[2010-03-17 08:56:45Z][Error] TF261007: Team Foundation Sever encountered the following internal error while trying to restore the application-level configuration values: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.. Try the attach operation again.&lt;/em&gt;&lt;/font&gt;&lt;/p&gt; Since it failed at the lab management step, I assumed it would be related to my old lab management settings and therefore I tried to run the following command on the TFS server to try to get rid of those settings.   &lt;p&gt;&lt;i&gt;&lt;font color="#008000"&gt;TfsConfig Lab /Delete /CollectionName:APODefaultCollection /External&lt;/font&gt;&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;But that resulted in the following exception to be thrown: “&lt;i&gt;&lt;font color="#ff0000"&gt;Exception of type &amp;#39;Microsoft.TeamFoundation.Framework.Server.HostShutdownException&amp;#39; was thrown&lt;/font&gt;” .&lt;/i&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;So there I was with a chicken egg problem. Could not run the command since the collection is not online, but can’t get the collection online since I have an issue with the Lab management environment. &lt;/em&gt;&lt;em&gt;Fortunately I was able to fix this. It took way more effort then Expected, but it all works again.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;So what did I do?&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Since the problem was related to Lab management I tried to set up lab management in the hope it would let me attach the collection.&lt;/em&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;em&gt;I installed &lt;/em&gt;VMM Admin console and VMM manager, but that caused me a headache as well :-(&lt;/li&gt;    &lt;li&gt;Install SVMM failed because it has some issues with DNS?!?! (Apparently SVMM installer can’t cope with using the “.” as the name of the server for the database. I needed to specify the full NETBIOS or DNS name. If you use “.” you will get a message that setup fails on a DNS resolve issue.)&lt;/li&gt;    &lt;li&gt;Next I tried to Configure Lab Management , but unfortunately needed to change the TFS service account to use a different domain account since my TFS services need to run in a different context now. Network Service can’t be used to communicate to the lab environment, so i need a different user account for that.&lt;/li&gt;    &lt;li&gt;So I got a new domain account , changed the service account for TFS&lt;/li&gt;    &lt;li&gt;Tried to configure Lab Management again. That results in the following error:&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/clip_5F00_image0021_5F00_54F06068.jpg"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:block;float:none;margin-left:auto;border-top:0px;margin-right:auto;border-right:0px;" title="clip_image002[1]" border="0" alt="clip_image002[1]" src="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/clip_5F00_image0021_5F00_thumb_5F00_749F3A30.jpg" width="407" height="432" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p align="left"&gt;&lt;font color="#ff0000" size="2"&gt;&lt;em&gt;Message details:         &lt;br /&gt;&lt;/em&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&lt;em&gt;---------------------------         &lt;br /&gt;&lt;/em&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&lt;em&gt;Lab Management         &lt;br /&gt;&lt;/em&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&lt;em&gt;---------------------------         &lt;br /&gt;&lt;/em&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&lt;em&gt;tf255231: The following name of the server running Virtual Machine Manager Server name cannot be changed because resources are associated with it: TAPTFS01.corp.infosupport.com. Delete the host groups and library shares for each team project collection. Then try the operation again.&lt;/em&gt;&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Next you click Cancel and will see the following results:&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/clip_5F00_image004_5F00_185861CB.jpg"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:block;float:none;margin-left:auto;border-top:0px;margin-right:auto;border-right:0px;" title="clip_image004" border="0" alt="clip_image004" src="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/clip_5F00_image004_5F00_thumb_5F00_45D9818E.jpg" width="779" height="488" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Next I just tried to reconnect the collection. And what do you know, it attached again!&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/clip_5F00_image006_5F00_735AA151.jpg"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:block;float:none;margin-left:auto;border-top:0px;margin-right:auto;border-right:0px;" title="clip_image006" border="0" alt="clip_image006" src="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/clip_5F00_image006_5F00_thumb_5F00_24E60EE7.jpg" width="408" height="273" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;So it now my collection is restored, except for lab management what is expected.&lt;/li&gt;    &lt;li&gt;Last step was now to run the command to clean up the Lab management configuration.      &lt;br /&gt;&lt;i&gt;&lt;font color="#008000" size="2"&gt;TfsConfig Lab /Delete /CollectionName:APODefaultCollection /External&lt;/font&gt;&lt;/i&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;This time it succeeded and now I am good to go ….. pfewww :-)&lt;/p&gt;  &lt;p&gt;Hope this helps you if you might hit this same issue. &lt;/p&gt;  &lt;p&gt;cheers,&lt;/p&gt;  &lt;p&gt;Marcel &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.infosupport.com/aggbug.aspx?PostID=201859" width="1" height="1"&gt;</description><feedburner:origLink>http://blogs.infosupport.com/blogs/marcelv/archive/2010/03/19/tfs-2010-tf261007-error-message-when-attaching-a-collection.aspx</feedburner:origLink></item><item><title>SDN Session Visual Studio 2010 Architecture tools</title><link>http://feedproxy.google.com/~r/Marcelv/~3/DWOy1gsMWac/sdn-session-visual-studio-2010-architecture-tools.aspx</link><pubDate>Wed, 17 Mar 2010 08:30:39 GMT</pubDate><guid isPermaLink="false">56f6167b-0c51-4839-ab2d-34653eeb5c9c:201848</guid><dc:creator>marcelv</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://blogs.infosupport.com/blogs/marcelv/rsscomments.aspx?PostID=201848</wfw:commentRss><comments>http://blogs.infosupport.com/blogs/marcelv/archive/2010/03/17/sdn-session-visual-studio-2010-architecture-tools.aspx#comments</comments><description>&lt;p&gt;Last evening I delivered a session for Software Developers Network. You can find the pdf version of the slides over &lt;a href="http://blogs.infosupport.com/media/p/201847.aspx" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Cheers,&lt;/p&gt;  &lt;p&gt;Marcel&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.infosupport.com/aggbug.aspx?PostID=201848" width="1" height="1"&gt;</description><feedburner:origLink>http://blogs.infosupport.com/blogs/marcelv/archive/2010/03/17/sdn-session-visual-studio-2010-architecture-tools.aspx</feedburner:origLink></item><item><title>Article in MSDN magazine got published</title><link>http://feedproxy.google.com/~r/Marcelv/~3/E53sCzAQteI/article-in-msdn-magazine-got-published.aspx</link><pubDate>Mon, 14 Dec 2009 23:58:36 GMT</pubDate><guid isPermaLink="false">56f6167b-0c51-4839-ab2d-34653eeb5c9c:76052</guid><dc:creator>marcelv</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://blogs.infosupport.com/blogs/marcelv/rsscomments.aspx?PostID=76052</wfw:commentRss><comments>http://blogs.infosupport.com/blogs/marcelv/archive/2009/12/14/article-in-msdn-magazine-got-published.aspx#comments</comments><description>&lt;p&gt;Well it has been an interesting journey, but today I found that the article I wrote with Brian A. Randell early this year on creating a custom team explorer extension got published. I haven’t received the glossy copy yet, but my search on MSDN resulted in the December issue that has it even as a featured article on the cover :-)&lt;/p&gt;  &lt;p&gt;&lt;a title="http://msdn.microsoft.com/en-us/magazine/ee819132.aspx" href="http://msdn.microsoft.com/en-us/magazine/ee819132.aspx"&gt;http://msdn.microsoft.com/en-us/magazine/ee819132.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;It is just great to see that it finally made it and I want to give a big thank you to &lt;a href="http://mcwtech.com/blogs/brianr" target="_blank"&gt;Brian&lt;/a&gt;, Dennis and &lt;a href="http://blogs.msdn.com/buckh/" target="_blank"&gt;Buck&lt;/a&gt; for their help on getting this published.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.infosupport.com/aggbug.aspx?PostID=76052" width="1" height="1"&gt;</description><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/Team+System+Extensibility/default.aspx">Team System Extensibility</category><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/Team+Foundation+Server/default.aspx">Team Foundation Server</category><feedburner:origLink>http://blogs.infosupport.com/blogs/marcelv/archive/2009/12/14/article-in-msdn-magazine-got-published.aspx</feedburner:origLink></item><item><title>Creating Custom DGML Diagrams using the Progression API</title><link>http://feedproxy.google.com/~r/Marcelv/~3/j2JS0wf9-RI/creating-custom-dgml-diagrams-using-the-progression-api.aspx</link><pubDate>Fri, 13 Nov 2009 20:24:37 GMT</pubDate><guid isPermaLink="false">56f6167b-0c51-4839-ab2d-34653eeb5c9c:36906</guid><dc:creator>marcelv</dc:creator><slash:comments>2</slash:comments><wfw:commentRss>http://blogs.infosupport.com/blogs/marcelv/rsscomments.aspx?PostID=36906</wfw:commentRss><comments>http://blogs.infosupport.com/blogs/marcelv/archive/2009/11/13/creating-custom-dgml-diagrams-using-the-progression-api.aspx#comments</comments><description>&lt;p&gt;Thursday night I presented a Session for the VSUG in Belgium, with the title “Modeling that works with code”. In this session I demonstrated how we can add more value into models and diagrams and how that can help us to keep our model in sync with the actual codebase we work on. (You can download the presentation &lt;a href="http://blogs.infosupport.com/media/p/36905.aspx" target="_blank"&gt;here&lt;/a&gt;)&lt;/p&gt;  &lt;p&gt;During this session I also addressed the concept of creating your own custom DGML diagram, using the progression API, that can be found in the visual studio directories.&lt;/p&gt;  &lt;p&gt;In this post I want to describe how you can create a Custom DGML diagram. I will show you how you can use the standard Coverage files you get from the Microsoft Test tools and use that data to create a diagram that shows which classes have a coverage percentage below a defined quality bar.&lt;/p&gt;  &lt;p&gt;When you want to create a DGML diagram, you can do that by using the Progression API. You can find the classes you need in the following assemblies :&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Microsoft.VisualStudio.Progression.Common &lt;/li&gt;    &lt;li&gt;Microsoft.VisualStudio.Progression.GraphModel &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Just use the add reference dialog and browse to the following location:    &lt;br /&gt;&amp;lt;installdrive&amp;gt;:\Program Files\visual Studio 10\Common7\Ide\PrivateAssemblies     &lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;em&gt;note:on a 64 bit machine this is program Files (x86) instead of program files&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;I want to create a new diagram, so to start, I need an instance of a Graph object. This is nothing more than just creating an instance of the Graph class. Now I want to define some custom metadata to my Nodes, that contain the code coverage information. For that purpose, I register a custom metadata property of the type double with the name “CodeCoverage” and I register it to be available on the Nodes in my diagram.&lt;/p&gt;  &lt;p&gt;So the only thing I need to do is load the Code Coverage XML file, use an XLinq query to get only the Class nodes and then create a loop that generates the nodes I want to add to the diagram.&lt;/p&gt;  &lt;p&gt;The code for this is like follows:&lt;/p&gt;  &lt;pre class="code"&gt;Graph DgmlGraph = Graph.Load(filetoAnnotate);
GraphProperty codeCoverageProperty =
GraphProperty.Register(&lt;span style="color:#a31515;"&gt;&amp;quot;CodeCoverage&amp;quot;&lt;/span&gt;, &lt;span style="color:blue;"&gt;typeof&lt;/span&gt;(&lt;span style="color:blue;"&gt;double&lt;/span&gt;),
GraphMetadata.Default, &lt;span style="color:blue;"&gt;typeof&lt;/span&gt;(Node));
&lt;span style="color:blue;"&gt;var &lt;/span&gt;codeCoverageXmlFile = XElement.Load(coverageFileName);
&lt;span style="color:blue;"&gt;foreach &lt;/span&gt;(&lt;span style="color:blue;"&gt;var &lt;/span&gt;classCoverageNode &lt;span style="color:blue;"&gt;in &lt;/span&gt;codeCoverageXmlFile.Descendants(&lt;span style="color:#a31515;"&gt;&amp;quot;Class&amp;quot;&lt;/span&gt;))
{
    &lt;span style="color:blue;"&gt;var &lt;/span&gt;classname = classCoverageNode.Element(&lt;span style="color:#a31515;"&gt;&amp;quot;ClassName&amp;quot;&lt;/span&gt;).Value;
    &lt;span style="color:blue;"&gt;int &lt;/span&gt;linesCovered = &lt;span style="color:blue;"&gt;int&lt;/span&gt;.Parse(classCoverageNode.Element(&lt;span style="color:#a31515;"&gt;&amp;quot;LinesCovered&amp;quot;&lt;/span&gt;).Value);
    &lt;span style="color:blue;"&gt;int &lt;/span&gt;linesNotCovered = &lt;span style="color:blue;"&gt;int&lt;/span&gt;.Parse(classCoverageNode.Element(&lt;span style="color:#a31515;"&gt;&amp;quot;LinesNotCovered&amp;quot;&lt;/span&gt;).Value);
    &lt;span style="color:blue;"&gt;int &lt;/span&gt;linesPartiallyCovered =
        &lt;span style="color:blue;"&gt;int&lt;/span&gt;.Parse(classCoverageNode.Element(&lt;span style="color:#a31515;"&gt;&amp;quot;LinesPartiallyCovered&amp;quot;&lt;/span&gt;).Value);
    &lt;span style="color:blue;"&gt;int &lt;/span&gt;totalLines = linesCovered + linesNotCovered + linesPartiallyCovered;
    &lt;span style="color:blue;"&gt;double &lt;/span&gt;coveragePercentage = (linesCovered * 100 / totalLines);
    Node coverageNode = &lt;span style="color:blue;"&gt;new &lt;/span&gt;Node(className);
    coverageNode.SetValue&amp;lt;&lt;span style="color:blue;"&gt;double&lt;/span&gt;&amp;gt;(codeCoverageProperty, coveragePercentage);
    DgmlGraph.Nodes.Add(coverageNode);
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;So now I have a Graph, that contains nodes and each node has the percentage code coverage set.&lt;/p&gt;

&lt;p&gt;Finally, I need to define specific styles so the diagram shows which classes are below a certain code coverage percentage and which are above. For that you can add so called Conditional Styles to the diagram. This is also very straightforward to do.&lt;/p&gt;

&lt;p&gt;You just create a new ConditionalStyle object instance and give it the graph as argument. Then you define to what type of element it needs to be applied to in the DGML diagram. So for this purpose we define this style to be applied to the “Node “ type. Next you give it a Label and last but not least a Condition. The expressions that evaluate if it needs to apply the condition can use all information in the model. The expression syntax can be found here (&lt;a href="http://msdn.microsoft.com/en-us/library/dd409453(VS.100).aspx#Highlight)"&gt;http://msdn.microsoft.com/en-us/library/dd409453(VS.100).aspx#Highlight)&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So for this diagram, I want to apply the style to all nodes with Code Coverage &amp;gt; 80. Therefore I need to apply the following expression: “CodeCoverage &amp;gt; 80”&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;var &lt;/span&gt;ConditionalStyle = &lt;span style="color:blue;"&gt;new &lt;/span&gt;ConditionalStyle(DgmlGraph);
ConditionalStyle.TargetType = &lt;span style="color:blue;"&gt;typeof&lt;/span&gt;(Node);
ConditionalStyle.GroupLabel = &lt;span style="color:#a31515;"&gt;&amp;quot;Coverage &amp;gt; 80%&amp;quot;&lt;/span&gt;;
&lt;span style="color:blue;"&gt;var &lt;/span&gt;Condition = &lt;span style="color:blue;"&gt;new &lt;/span&gt;Condition(ConditionalStyle);
Condition.Expression = &lt;span style="color:#a31515;"&gt;&amp;quot;CodeCoverage &amp;gt; 80&amp;quot;&lt;/span&gt;;
ConditionalStyle.Conditions.Add(Condition);
DgmlGraph.Styles.Add(ConditionalStyle);&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;Now the last thing I need to do is define what property of a node visualization I want to change on this ConditionalStyle. I choose to set an Icon to be a green checkmark and the background to green&lt;/p&gt;

&lt;p&gt;&lt;span style="color:blue;"&gt;var &lt;/span&gt;CodeCoverageSetterBackGround = &lt;span style="color:blue;"&gt;new &lt;/span&gt;Setter(ConditionalStyle, &lt;span style="color:#a31515;"&gt;&amp;quot;BackGround&amp;quot;&lt;/span&gt;); 

  &lt;br /&gt;CodeCoverageSetterBackGround.Value = &lt;span style="color:#a31515;"&gt;&amp;quot;#FF00FF00&amp;quot;&lt;/span&gt;; 

  &lt;br /&gt;ConditionalStyle.Setters.Add(CodeCoverageSetterBackGround); 

  &lt;br /&gt;&lt;span style="color:blue;"&gt;var &lt;/span&gt;CodeCoverageSetterIcon = &lt;span style="color:blue;"&gt;new &lt;/span&gt;Setter(ConditionalStyle, &lt;span style="color:#a31515;"&gt;&amp;quot;Icon&amp;quot;&lt;/span&gt;); 

  &lt;br /&gt;CodeCoverageSetterIcon.Value = &lt;span style="color:#a31515;"&gt;&amp;quot;pack://application:,,,/Microsoft.VisualStudio.Progression.GraphControl;component/Icons/kpi_green_sym2_large.png&amp;quot;&lt;/span&gt;; 

  &lt;br /&gt;ConditionalStyle.Setters.Add(CodeCoverageSetterIcon); 

  &lt;br /&gt;&lt;/p&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;I also did the same for coverage below 80% and set that style to be Red and use the Icon type “Node.Error”. &lt;/p&gt;

&lt;p&gt;So now when I run my program with a code coverage file, I will get the following results:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/clip_5F00_image002_5F00_2C93AC63.jpg"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="clip_image002" border="0" alt="clip_image002" src="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/clip_5F00_image002_5F00_thumb_5F00_7993F62E.jpg" width="895" height="417" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In a next post, I will show you how you can also leverage the DGML diagrams generated with the architecture explorer and then applying this same code coverage information to that diagram, so you can decide which classed need additional effort in getting better coverage.&lt;/p&gt;

&lt;p&gt;Cheers, 
  &lt;br /&gt;Marcel&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.infosupport.com/aggbug.aspx?PostID=36906" width="1" height="1"&gt;</description><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/Team+System+Extensibility/default.aspx">Team System Extensibility</category><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/DSL/default.aspx">DSL</category><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/MVP/default.aspx">MVP</category><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/Team+Foundation+Server/default.aspx">Team Foundation Server</category><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/Regional+Director/default.aspx">Regional Director</category><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/Visual+Studio+2010/default.aspx">Visual Studio 2010</category><feedburner:origLink>http://blogs.infosupport.com/blogs/marcelv/archive/2009/11/13/creating-custom-dgml-diagrams-using-the-progression-api.aspx</feedburner:origLink></item><item><title>How to make VSTS DBPro work with the default database collation</title><link>http://feedproxy.google.com/~r/Marcelv/~3/ffenAChw1As/how-to-make-vsts-dbpro-work-with-the-default-database-collation.aspx</link><pubDate>Tue, 08 Sep 2009 22:59:38 GMT</pubDate><guid isPermaLink="false">56f6167b-0c51-4839-ab2d-34653eeb5c9c:19433</guid><dc:creator>marcelv</dc:creator><slash:comments>2</slash:comments><wfw:commentRss>http://blogs.infosupport.com/blogs/marcelv/rsscomments.aspx?PostID=19433</wfw:commentRss><comments>http://blogs.infosupport.com/blogs/marcelv/archive/2009/09/08/how-to-make-vsts-dbpro-work-with-the-default-database-collation.aspx#comments</comments><description>&lt;p&gt;today, I had a few hours of frustration, getting all databases in our project use the same collation.&lt;/p&gt;  &lt;p&gt;What I wanted to achieve is that we would use the default collation of &lt;strong&gt;Latin1_General_CI_AS&lt;/strong&gt; but not script that in our SQL scripts.&lt;/p&gt;  &lt;p&gt;To start, for some reason the DBPro team decided not to use the names we are used to when we are working with collations. The list we all know (and love ahum ..) doe not show any relationship with the names used for the model collation. So first you need to figure out that English(United States) (1033) – CS, means &lt;strong&gt;Latin1_General_CS_AS&lt;/strong&gt; .&lt;/p&gt;  &lt;p&gt;As you might know the default collation for SQL 2008 default installation on an US English machine is &lt;strong&gt;Latin1_General_CI_AS&lt;/strong&gt;, so that does not match by default. So I started to change this setting in all our database projects. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/image_5F00_624B9F45.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/image_5F00_thumb_5F00_0453FB0C.png" width="627" height="316" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Then I wanted to set the scripts not to contain the collation in the scripts. To do this you can go to the&amp;#160; deploy Tab and then click the Deployment Configuration file Edit button.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/image_5F00_705A6875.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/image_5F00_thumb_5F00_4E225CEF.png" width="645" height="336" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;There you will get the following settings page with the dropdown where you can select the “deployment collation default” for your DBPro project.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/image_5F00_2BEA5169.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/image_5F00_thumb_5F00_71FB0E7C.png" width="571" height="380" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now we get to the fun part, because when you select the option “Do not script the collation” and you hit the deploy button I constantly got the message:&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;strong&gt;Warning TSD00258: The project and target databases have different collation settings. Deployment errors might occur.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Now that is interesting, I know my database is the default collation, I set the project to use English(United States) (1033), so why do I get this message?!?&lt;/p&gt;  &lt;p&gt;So after some searching I found yet another location where you can set the collation and that is in the Catalog properties file on the first properties page. So I selected the option edit and got the following page:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/image_5F00_2ECF904F.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/image_5F00_thumb_5F00_4B890564.png" width="603" height="379" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Ok so I see, the collation is here CS and a SQL collation, so I changed that one also to &lt;strong&gt;Latin1_General_CI_AS.&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;So now I should be good right?&lt;/p&gt;  &lt;p&gt;Well no, no luck. It just seems there is no way to get rid of the message telling me I have a different collation then the target database.&lt;/p&gt;  &lt;p&gt;At this moment I am just stumped and do some additional inquiries why this is the case. The only way for now to make it work for me without warnings during build, is to set the “deployment collation default” back to “Use the collation of my project”. &lt;/p&gt;  &lt;p&gt;It seems like a bug at this moment that I get this warning, but once I know for sure, i will post the update here.&lt;/p&gt;  &lt;p&gt;Cheers,&lt;/p&gt;  &lt;p&gt;Marcel&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.infosupport.com/aggbug.aspx?PostID=19433" width="1" height="1"&gt;</description><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/Team+System/default.aspx">Team System</category><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/SQL+2008/default.aspx">SQL 2008</category><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/Database+profesional/default.aspx">Database profesional</category><feedburner:origLink>http://blogs.infosupport.com/blogs/marcelv/archive/2009/09/08/how-to-make-vsts-dbpro-work-with-the-default-database-collation.aspx</feedburner:origLink></item><item><title>Silverlight error messages can be very cryptic or even inappropriate sometimes</title><link>http://feedproxy.google.com/~r/Marcelv/~3/ztHCiNVVvbM/silverlight-error-messages-can-be-very-cryptic-or-even-inappropriate-sometimes.aspx</link><pubDate>Sun, 30 Aug 2009 20:26:00 GMT</pubDate><guid isPermaLink="false">56f6167b-0c51-4839-ab2d-34653eeb5c9c:16770</guid><dc:creator>marcelv</dc:creator><slash:comments>4</slash:comments><wfw:commentRss>http://blogs.infosupport.com/blogs/marcelv/rsscomments.aspx?PostID=16770</wfw:commentRss><comments>http://blogs.infosupport.com/blogs/marcelv/archive/2009/08/30/silverlight-error-messages-can-be-very-cryptic-or-even-inappropriate-sometimes.aspx#comments</comments><description>&lt;p&gt;The past few days I have been working on a simple proof of concept where we want to replace some of the dashboards we have that where build in Flex/Flash with Silverlight 3 controls.&lt;/p&gt;  &lt;p&gt;The reason to switch has most to do with the fact we can maintain all our codebase with one single technology instead of having many different technologies. The proof of concept just needs to show we can get the same functionality and have better development and debugging experience then we have today.&lt;/p&gt;  &lt;p&gt;So during some work I did, I needed to just call an existing web service that already has an crossdomain.xml file deployed on the website. Now it happens to be that this web service is part of our SharePoint portal. Once I created the proxy by just adding a web reference, I created the simple code to call the service and wait for the data to get back:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;pre class="code"&gt;DisplayNames.&lt;span style="color:#2b91af;"&gt;DisplayNameSoapClient &lt;/span&gt;client = &lt;span style="color:blue;"&gt;new &lt;/span&gt;BuildStats.DisplayNames.&lt;span style="color:#2b91af;"&gt;DisplayNameSoapClient&lt;/span&gt;();
client.GetViewDataCompleted+=&lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;EventHandler&lt;/span&gt;&amp;lt;BuildStats.DisplayNames.&lt;span style="color:#2b91af;"&gt;GetViewDataCompletedEventArgs&lt;/span&gt;&amp;gt;(client_GetViewDataCompleted);
client.GetViewDataAsync(&lt;span style="color:#a31515;"&gt;&amp;quot;Budget (Earned Value)&amp;quot;&lt;/span&gt;,&lt;span style="color:#a31515;"&gt;&amp;quot;Highlight&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;As you can see very simple code. Now when I tried to get this code to work, I constantly got the same exception message time and time again, and I just could not understand what was going wrong.&lt;/p&gt;

&lt;p&gt;The message I got was the following:(XXXX is the name of the server I just left out)&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;i&gt;An error occurred while trying to make a request to URI &amp;#39;http://xxxxxx/sites/endstp/dev/_vti_bin/DisplayName.asmx&amp;#39;. This could be due to attempting to access a service in a cross-domain way without a proper cross-domain policy in place, or a policy that is unsuitable for SOAP services. You may need to contact the owner of the service to publish a cross-domain policy file and to ensure it allows SOAP-related HTTP headers to be sent. This error may also be caused by using internal types in the web service proxy without using the InternalsVisibleToAttribute attribute. Please see the inner exception for more details.&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;It took me a very long time to get my head around what was happening here, since I used the same service as the flex control was using and we already had the crossdomain.xml deployed. I used &lt;a href="http://www.fiddler2.com/fiddler2/"&gt;fiddler&lt;/a&gt; to see if the crossdomain.xml file was retrieved and I could see it did get the file. So what was happening here? Well as after reading the message over and over again, I finally picked out the following part of the message: “&lt;b&gt;&lt;i&gt;or a policy that is unsuitable for SOAP services”&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;It happened to be that the way the flex control retrieved the data was different the I did with Silverlight. Therefore I needed to alter the crossdomain.xml file to also include a SOAP call. So the file I now used looks like follows:(See &lt;strong&gt;bold &lt;/strong&gt;line that fixed the problem for me)&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color:#a31515;"&gt;xml &lt;/span&gt;&lt;span style="color:red;"&gt;version&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;1.0&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;?&amp;gt;
&amp;lt;!&lt;/span&gt;&lt;span style="color:#a31515;"&gt;DOCTYPE &lt;/span&gt;&lt;span style="color:red;"&gt;cross-domain-policy &lt;/span&gt;&lt;span style="color:blue;"&gt;SYSTEM &lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cross-domain-policy&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;allow-access-from &lt;/span&gt;&lt;span style="color:red;"&gt;domain&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;*&lt;/span&gt;&amp;quot; &lt;span style="color:red;"&gt;secure&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;false&lt;/span&gt;&amp;quot; &lt;span style="color:blue;"&gt;/&amp;gt;
 &lt;strong&gt; &amp;lt;&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="color:#a31515;"&gt;allow-http-request-headers-from &lt;/span&gt;&lt;span style="color:red;"&gt;domain&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;*&lt;/span&gt;&amp;quot; &lt;span style="color:red;"&gt;headers&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;SOAPAction&lt;/span&gt;&amp;quot;&lt;/strong&gt;&lt;span style="color:blue;"&gt;&lt;strong&gt;/&amp;gt;
&lt;/strong&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cross-domain-policy&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;I know for production use we should not allow just anybody to do calls against our server, but since this is only used during development, this is fine for me now. Once the control is implemented it won’t be making cross domain calls anymore and I don’t need the file. (it is not a part of the deployment package)&lt;/p&gt;

&lt;p&gt;So after fixing that I was able to get the data and plot the simple graphs based on the data I got. So all was good again.&lt;/p&gt;

&lt;p&gt;But then one day later, I started some additional work on the same project and I got the exact same error message again!?!?!?&lt;/p&gt;

&lt;p&gt;So how could that be? I wanted to start and see if the cross domain file might be incorrect or changed by someone else and then I found that the network was not even up and running! So I just simply forgot to plug in my network cable before I start to work and I got the exact same message!&lt;/p&gt;

&lt;p&gt;Now I must say that encrypting an error message in such a way it will take a while to figure out what is wrong is one thing, but using the exact same message while there is not even a network available, just beats me. I know that with security in mind, you don’t always want to provide a lot of diagnostics what might be the issue, but just giving everybody a walk around the park with a generic message , just makes no sense to me. I really hope this is not a new trend in security practices. &lt;/p&gt;

&lt;p&gt;Cheers,&lt;/p&gt;

&lt;p&gt;Marcel&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.infosupport.com/aggbug.aspx?PostID=16770" width="1" height="1"&gt;</description><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/.NET+development/default.aspx">.NET development</category><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/Silverlight/default.aspx">Silverlight</category><feedburner:origLink>http://blogs.infosupport.com/blogs/marcelv/archive/2009/08/30/silverlight-error-messages-can-be-very-cryptic-or-even-inappropriate-sometimes.aspx</feedburner:origLink></item><item><title>Deep dive event at the Microsoft north Carolina office</title><link>http://feedproxy.google.com/~r/Marcelv/~3/zFHpNrbaC-4/deep-dive-event-at-the-microsoft-north-carolina-office.aspx</link><pubDate>Wed, 12 Aug 2009 12:14:00 GMT</pubDate><guid isPermaLink="false">56f6167b-0c51-4839-ab2d-34653eeb5c9c:16626</guid><dc:creator>marcelv</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://blogs.infosupport.com/blogs/marcelv/rsscomments.aspx?PostID=16626</wfw:commentRss><comments>http://blogs.infosupport.com/blogs/marcelv/archive/2009/08/12/deep-dive-event-at-the-microsoft-north-carolina-office.aspx#comments</comments><description>&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;I Just got back from my holiday in Tuscany Italy, and am already on the road again. We had a great opportunity to visit the Microsoft Team System development team in Raleigh NC. &lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;/span&gt;The team over there is responsible for the Team Foundation Server, Team Web Access, Team Test, Setup &amp;amp; Ops &lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;/span&gt;and Team Build. The last one is of particular interest to us, since we rely on Team System and Team build in particular for our software factory Endeavour.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;With the 2008 Product we integrate very tightly with and we want to have the same or even a better experience with the 2010 version coming down the pipe. As you all might now by now when you have looked at the B1 bits, is that there are significantly changes between 2008 en 2010. The biggest part is that team build is now using windows Workflow Foundation as the engine behind the build process instead of the MSBuild scripts we had in 2008. Now that adds some pro&amp;rsquo;s and con&amp;rsquo;s in terms of building our custom experience on top of that. E.g one thing we will going to miss is the option to only extend the process on specific predefined build targets and adding in our own steps to the process. With 2010 there is no notion of an extensible build script anymore and you will get an workflow instead that you need to copy and tweak according to your needs. On the other hand, it is really great that you can see a visual representation on what the process will look like in terms of phases and steps that compose the build.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;One area where we extended the Visual Studio 2008 IDE is in the build configuration wizard. We extended the default dialog to work with our factory concept of Configuration Items (CI&amp;rsquo;s) instead of crafting up a workspace and selecting solution from there. &lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;/span&gt;See screenshot below to give you an idea on how we extended the build definition dialog.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;a href="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/BuildDialogExtension1.PNG"&gt;&lt;img src="http://blogs.infosupport.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/BuildDialogExtension1.PNG" border="0" alt="" /&gt;&lt;/a&gt;&lt;a href="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/BuildDialogExtension2.PNG"&gt;&lt;img src="http://blogs.infosupport.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/BuildDialogExtension2.PNG" border="0" alt="" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;For us a CI is defined as the unit of design, development, test and deployment. A CI can consist out of multiple modules and a module contains a solution or a MSBuild script that does some funky stuff needed for a certain folder in Version control to be build. We knew upfront that build would change drastically in 2010, but we took the decision to create the 2008 experience first and based on what we learn from that build the same or improved version in 2010.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;As part of our elaboration work on 2010, we flew over to the NC office and had our first two days of meetings with the team build team. We had the opportunity to look at the current status of the product and work with the team to discuss how we can integrate our notion of a build with the out of box experience of Team Build.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;I must say I am pretty pleased in terms of what I see coming in the B2 timeframe which I cannot discuss in public yet, but I can say we have seen significant improvements to the B1 that is out there at this moment.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;Our goal is to have a good design crafted up by the end of the week in terms of how we are going to integrate with team build 2010 and even have some early proof of concepts that will work once we get B2. &lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;/span&gt;Once I am able to speak public about the B2 build, you can see a couple of post up here on how we use the 2010 engine and how you can create and manage your own build processes, just the way we are doing that as well.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;Cheers,&lt;br /&gt;Marcel&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.infosupport.com/aggbug.aspx?PostID=16626" width="1" height="1"&gt;</description><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/Team+System/default.aspx">Team System</category><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/Working+at+Info+Support/default.aspx">Working at Info Support</category><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/Team+System+Extensibility/default.aspx">Team System Extensibility</category><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/Rosario/default.aspx">Rosario</category><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/Visual+Studio+2010/default.aspx">Visual Studio 2010</category><feedburner:origLink>http://blogs.infosupport.com/blogs/marcelv/archive/2009/08/12/deep-dive-event-at-the-microsoft-north-carolina-office.aspx</feedburner:origLink></item><item><title>How to fix Team build Error in TFS2010 “MSTest.exe not found”</title><link>http://feedproxy.google.com/~r/Marcelv/~3/45y1-gP2IQ4/how-to-fix-team-build-error-in-tfs2010-mstest-exe-not-found.aspx</link><pubDate>Thu, 11 Jun 2009 11:57:28 GMT</pubDate><guid isPermaLink="false">56f6167b-0c51-4839-ab2d-34653eeb5c9c:16127</guid><dc:creator>marcelv</dc:creator><slash:comments>5</slash:comments><wfw:commentRss>http://blogs.infosupport.com/blogs/marcelv/rsscomments.aspx?PostID=16127</wfw:commentRss><comments>http://blogs.infosupport.com/blogs/marcelv/archive/2009/06/11/how-to-fix-team-build-error-in-tfs2010-mstest-exe-not-found.aspx#comments</comments><description>&lt;p&gt;I must say it really helps a lot when you have someone available from the dev teams to solve some issues with the Beta Bits. As I told in my previous post I worked with Adam Bar from the Microsoft North Carolina Office for our devdays pre-conference. While working on my demo’s I ran into a problem where I did have a tests working locally, but once I ran an Team Build on the solution, I always got the message that MSTest.exe could not be found.&lt;/p&gt;  &lt;p&gt;This happened to be a known bug on 64 bit machines and can easily be fixed by adding a registry key to the non wow64 node in the registry. It appears that in Beta 1, from the team build environment the location of MSTest is searched in the non 64bit registry location. What you need to do to fix this problem is the following:&lt;/p&gt;  &lt;p&gt;Use regedit to add the following Key:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;em&gt;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Key Name: &lt;strong&gt;&lt;em&gt;InstallDir &lt;/em&gt;&lt;/strong&gt;and set that key to the location where Visual Studio 2010 is installed (e.g. C:\program files\ Microsoft Visual Studio 10\Common7\IDE)&lt;/p&gt;  &lt;p&gt;Now start a new build and you will see the build will find MSTest again :-)    &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;Cheers,    &lt;br /&gt;Marcel&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.infosupport.com/aggbug.aspx?PostID=16127" width="1" height="1"&gt;</description><feedburner:origLink>http://blogs.infosupport.com/blogs/marcelv/archive/2009/06/11/how-to-fix-team-build-error-in-tfs2010-mstest-exe-not-found.aspx</feedburner:origLink></item><item><title>Visual Studio 2010 Beta 1: How to fix Worklow designer crash</title><link>http://feedproxy.google.com/~r/Marcelv/~3/vbr4bRAUFDE/visual-studio-2010-beta-1-how-to-fix-worklow-designer-crash.aspx</link><pubDate>Wed, 10 Jun 2009 19:54:37 GMT</pubDate><guid isPermaLink="false">56f6167b-0c51-4839-ab2d-34653eeb5c9c:16118</guid><dc:creator>marcelv</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://blogs.infosupport.com/blogs/marcelv/rsscomments.aspx?PostID=16118</wfw:commentRss><comments>http://blogs.infosupport.com/blogs/marcelv/archive/2009/06/10/visual-studio-2010-beta-1-how-to-fix-worklow-designer-crash.aspx#comments</comments><description>&lt;p&gt;Last week I gave a presentation internally at our Info Support Knowledge Transfer evenings. Based on a deep dive training I got to attend on Campus begin of May, I presented a session on Windows Workflow 4.0. As you might know I am passionate about two technologies that I try to dig into as deep a s possible and those are visual Studio Team System and Windows Workflow Foundation. During the preparation of my talk on workflow, I obviously wanted to show some workflow designs and create some designs on the fly.&lt;/p&gt;  &lt;p&gt;But Every time I wanted to create a new Workflow, the designer crashed and Visual Studio got closed :-(&lt;/p&gt;  &lt;p&gt;It took me some while to discover that the crash was caused by the Visual Basic expression editor that gets activated once you create a workflow. This editor was unable to load a required assembly. It appears that this was caused by the fact that I installed Visual Studio at a different location then the default c:\ drive.&lt;/p&gt;  &lt;p&gt;In the Beta the bits don’t check the install directory location in the registry but just assume this to be the default location.&lt;/p&gt;  &lt;p&gt;But how could I fix this? I did install on D:\ and was not willing to install again, since that would take a lot of time.&lt;/p&gt;  &lt;p&gt;After some digging around I found a great solution that is posted at the &lt;a href="https://connect.microsoft.com/VisualStudio/feedback/Workaround.aspx?FeedbackID=457783" target="_blank"&gt;connect site&lt;/a&gt;. You can create a symbolic link at the OS level on the file system.     &lt;br /&gt;When you make a c:\profgram Files\Visual Studio 10.0 directory point to the actual installation on the D:\ drive the issue is solved.&lt;/p&gt;  &lt;p&gt;You can use the mklink command for that and specify the /J option to create a directory junction. After running mklink as an administrator and restarting Visual Studio , I was able to create workflows.&lt;/p&gt;  &lt;p&gt;Hope this helps if you run into the same issue.&lt;/p&gt;  &lt;p&gt;Cheers    &lt;br /&gt;Marcel&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.infosupport.com/aggbug.aspx?PostID=16118" width="1" height="1"&gt;</description><feedburner:origLink>http://blogs.infosupport.com/blogs/marcelv/archive/2009/06/10/visual-studio-2010-beta-1-how-to-fix-worklow-designer-crash.aspx</feedburner:origLink></item><item><title>How to make Layer Validation Diagrams work in the build</title><link>http://feedproxy.google.com/~r/Marcelv/~3/fWBGGvfEfFs/how-to-make-layer-validation-diagrams-work-in-the-build.aspx</link><pubDate>Tue, 09 Jun 2009 21:10:19 GMT</pubDate><guid isPermaLink="false">56f6167b-0c51-4839-ab2d-34653eeb5c9c:16114</guid><dc:creator>marcelv</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://blogs.infosupport.com/blogs/marcelv/rsscomments.aspx?PostID=16114</wfw:commentRss><comments>http://blogs.infosupport.com/blogs/marcelv/archive/2009/06/09/how-to-make-layer-validation-diagrams-work-in-the-build.aspx#comments</comments><description>&lt;p&gt;In Visual studio 2010 Team Architect edition, you have a new type of diagram available, called the layer diagram. What is great about this diagram is that you can use it to actually validate if the source code you have written adheres to the rules you defined in terms of allowed dependencies between layers. This adds great value to the notion of modeling the layers for your product and can help you mandate the rules you pose as an architect are actually followed by the development team.&lt;/p&gt;  &lt;p&gt;In the visual studio IDE you can run a layer validation just by right clicking the diagram and selecting the option Validate, as show in screenshot below:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/image_5F00_0DDDAE1C.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/image_5F00_thumb_5F00_2A972331.png" width="770" height="432" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;But what If I want to run this validation every time you compile the project, or even better during each build we run on the build server?&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/camerons/" target="_blank"&gt;Cameron Skinner&lt;/a&gt; has a &lt;a href="http://blogs.msdn.com/camerons/archive/2008/12/11/incorporate-layer-validation-in-your-builds.aspx" target="_blank"&gt;blog post&lt;/a&gt; based on the PDC CTP bits, on how you can create the layer diagram and link it into your solution for validation. The Beta 1 we currently use has the option to Validate default available in the dropdown of available actions for the linked diagram. But unfortunately it does not validate straight out of the box. &lt;/p&gt;  &lt;p&gt;It took me quite some digging around in the target files that come with the architect edition, but I discovered that there is a property called ValidateArchitectureOnBuild that enables or disables the layer validation during the build.&lt;/p&gt;  &lt;p&gt;So in order to enable the build during build, you must add this property to your build file. This can be done by unloading the project and adding the property to the property group that contains several options you select in the properties page of your project. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&amp;lt;PropertyGroup&amp;gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;…     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;font color="#ff0000"&gt;ValidateArchitectureOnBuild&lt;/font&gt;&amp;gt;true&amp;lt;/&lt;font color="#ff0000"&gt;ValidateArchitectureOnBuild&lt;/font&gt;&amp;gt;      &lt;br /&gt;&amp;lt;/PropertyGroup&amp;gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Once you reload the the project and run a local compile you will see the layer diagram is validated during the compilation pass.&lt;/p&gt;  &lt;p&gt;Hope this helps you get layer validation running as an integral part of your build process :-)&lt;/p&gt;  &lt;p&gt;cheers,   &lt;br /&gt;Marcel&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.infosupport.com/aggbug.aspx?PostID=16114" width="1" height="1"&gt;</description><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/Team+System/default.aspx">Team System</category><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/Architecture/default.aspx">Architecture</category><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/DSL/default.aspx">DSL</category><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/MVP/default.aspx">MVP</category><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/Rosario/default.aspx">Rosario</category><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/Visual+Studio+2010/default.aspx">Visual Studio 2010</category><feedburner:origLink>http://blogs.infosupport.com/blogs/marcelv/archive/2009/06/09/how-to-make-layer-validation-diagrams-work-in-the-build.aspx</feedburner:origLink></item><item><title>Devdays 2009</title><link>http://feedproxy.google.com/~r/Marcelv/~3/2Y0XTKuuXqY/devdays-2009.aspx</link><pubDate>Thu, 04 Jun 2009 21:11:47 GMT</pubDate><guid isPermaLink="false">56f6167b-0c51-4839-ab2d-34653eeb5c9c:16083</guid><dc:creator>marcelv</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://blogs.infosupport.com/blogs/marcelv/rsscomments.aspx?PostID=16083</wfw:commentRss><comments>http://blogs.infosupport.com/blogs/marcelv/archive/2009/06/04/devdays-2009.aspx#comments</comments><description>&lt;p&gt;It has been a few days since we held developer days conference here in the Netherlands. I Must say I was quite pleased to see there where so many attendees especially with the current economic situation.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.devdays.nl/" target="_blank"&gt;Devdays&lt;/a&gt; is always this special week in the year for me since I tend to always give sessions on the latest greatest technologies and they also happen to ship a CTP or beta drop just a week for such a conference. This year again I had to work day and night to get all demo’s working on the latest available bits since that gives the best impression for the attendees in terms of the current available feature set. This year I presented a Pre Conference session on Visual Studio Team System 2010, together with &lt;strong&gt;&lt;em&gt;Adam Barr&lt;/em&gt;&lt;/strong&gt;, who is a Test lead at Microsoft on Team foundation sever. Adam Arrived on Monday and we spend two days getting all the demo’s working correctly. Also Edd Glas from the Team Test Team got over and presented part of the preconference. We decided it was great for the preconference audience to have two people straight from the trenches telling about what they are building. The total content for the Pre Conference covers over 6 hours of content and demos on what is all in the product, and the feedback received during the session was very positive.&lt;/p&gt;  &lt;p&gt;On Devdays day 1, I got my personal 2 Minutes of fame during the Keynote Session. (aprox. 1800 people attending). Begin of January I have been selected to become a &lt;a href="http://www.theregion.com/profile.aspx?rd=1390" target="_blank"&gt;Microsoft regional Director&lt;/a&gt; for the Netherlands together with &lt;a href="http://blogs.class-a.nl/blogs/anko/" target="_blank"&gt;Anko Duizer&lt;/a&gt;. During the Keynote I was asked to talk in maximum 2 Minutes on my vision on ALM and what people should expect to happen in that space the coming year. I Got an picture of a Colleague of mine that has me on stage during the Keynote.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;a href="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/DSC00569_5F00_0600D4FB.jpg"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:block;float:none;margin-left:auto;border-top:0px;margin-right:auto;border-right:0px;" title="Devdays Keynote" border="0" alt="Devdays Keynote" src="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/DSC00569_5F00_thumb_5F00_2AB1EC72.jpg" width="472" height="359" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt; I must say it really looks different from the other side when you are on stage :-)&lt;/p&gt;  &lt;p&gt;The second Day I gave my Last session that is called “Modeling that works with code” where I show what you can do with all the great new Modeling and DSL stuff shipping with Team Architect Edition 2010. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/DSC00582_5F00_575AA64B.jpg"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:block;float:none;margin-left:auto;border-top:0px;margin-right:auto;border-right:0px;" title="DSC00582" border="0" alt="DSC00582" src="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/DSC00582_5F00_thumb_5F00_00160B95.jpg" width="467" height="355" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;This is where I showed the value of modeling up front and Bottom up by generating UML Sequence Diagrams and DGML Diagrams based on the code you have. One of the demo’s I gave was something I was able to craft up with the Help of &lt;a href="http://www.edwardbakker.nl/" target="_blank"&gt;Edward&lt;/a&gt; and &lt;a href="http://www.clemensreijnen.nl/" target="_blank"&gt;Clemens&lt;/a&gt;. This is a Demo where you can create new DGML Models using the available .NET API’s. This is very powerful if you e.g. use this in a Daily build and generate diagrams that show stuff like: Classes with a Code Coverage below a certain quality bar, Hot Maps in terms of code Churn mapped to all projects in your product, Lines of code expressed in the size of DGML Nodes, etc. It is amazing what the possibilities are. &lt;a href="http://www.clemensreijnen.nl/" target="_blank"&gt;Clemens&lt;/a&gt; and &lt;a href="http://www.edwardbakker.nl/" target="_blank"&gt;Edward&lt;/a&gt; are working e.g. on &lt;a href="http://www.edwardbakker.nl/PermaLink,guid,19de7161-769f-4b70-81b6-b435c0557093.aspx" target="_blank"&gt;Architectural Inspections&lt;/a&gt; based on the archetypes described in the Patterns And Practices application architecture guide. &lt;/p&gt;  &lt;p&gt;If you are interested in the slides from this session, you can download them &lt;a href="http://blogs.infosupport.com/media/p/16082.aspx" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;In a Next Post I will show you how easily you can create a new Diagram based on the available API, and some fixes on visual Studio 2010 I needed to make for all the demo’s to work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.infosupport.com/aggbug.aspx?PostID=16083" width="1" height="1"&gt;</description><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/Team+System/default.aspx">Team System</category><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/Working+at+Info+Support/default.aspx">Working at Info Support</category><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/Training+and+conferences/default.aspx">Training and conferences</category><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/MVP/default.aspx">MVP</category><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/Regional+Director/default.aspx">Regional Director</category><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/Visual+Studio+2010/default.aspx">Visual Studio 2010</category><feedburner:origLink>http://blogs.infosupport.com/blogs/marcelv/archive/2009/06/04/devdays-2009.aspx</feedburner:origLink></item><item><title>How to enable code coverage in Visual Studio 2010 Unit tests</title><link>http://feedproxy.google.com/~r/Marcelv/~3/4k8RT-YpnOE/how-to-enable-code-coverage-in-visual-studio-2010-unit-tests.aspx</link><pubDate>Thu, 21 May 2009 23:14:06 GMT</pubDate><guid isPermaLink="false">56f6167b-0c51-4839-ab2d-34653eeb5c9c:15951</guid><dc:creator>marcelv</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://blogs.infosupport.com/blogs/marcelv/rsscomments.aspx?PostID=15951</wfw:commentRss><comments>http://blogs.infosupport.com/blogs/marcelv/archive/2009/05/22/how-to-enable-code-coverage-in-visual-studio-2010-unit-tests.aspx#comments</comments><description>&lt;p&gt;When you want to Enable code coverage in an Unit test run in Visual Studio 2010 you may find that the steps you need to take have changed.    &lt;br /&gt;In Visual Studio 2010 you need to take the following steps:&lt;/p&gt;  &lt;p&gt;Open the Local.testsettings file and there you will see a set of items you can configure on the left hand of the dialog.    &lt;br /&gt;&lt;a href="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/image_5F00_6EE109F4.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/image_5F00_thumb_5F00_16C40954.png" width="525" height="395" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Here you need to select the “Execution Criteria” in the left list and then you can see at the bottom of the page the set of collectors that are enabled for a test run.&lt;/p&gt;  &lt;p&gt;In this list you need to select the “Code Coverage” item and mark the enabled check box. In the 2008 ide you would direct see the assemblies that are part of the coverage gathering during the run. In the 2010 dialog you can select the assemblies by first clicking on the “Code Coverage” row in the collectors list and then clicking the “Advanced…” button. Then you will see the more familiar dialog again as shown below:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/image_5F00_0D87CE13.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/image_5F00_thumb_5F00_40E3916F.png" width="479" height="331" /&gt;&lt;/a&gt;&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Here you need to pick the assembly that is under test and click “Ok”&lt;/p&gt;  &lt;p&gt;Now when you run another unit test you will see code coverage is now enabled.    &lt;br /&gt;When you take&amp;#160; a further look into the set of collectors you might also see a set of new collectors that you have not seen before.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/image_5F00_18D0E250.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/marcelv/image_5F00_thumb_5F00_47D31E27.png" width="447" height="336" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;When you enable e.g. the video recorder, you will get an video capture of your computer while the test was running. While this is less interesting for a Unit test that has no UI interactions, this is very interesting when you create a new type of test called Code UI test that can run an previously recorded UI test and replay it on a test machine. You can see the &lt;a href="http://channel9.msdn.com/shows/10-4/10-4-Episode-18-Functional-UI-Testing/" target="_blank"&gt;channel 9 video&lt;/a&gt; that shows more about coded UI testing if you want some more information on that new feature.&lt;/p&gt;  &lt;p&gt;What is interested to see is enabling e.g. the Test Impact collector, that enables the Test Impact feature. Once this collector has run, you can see in the Visual Studio IDE a list of suggested tests based on code changes you have made to your local source. This enables you to run a minimum set of tests to verify changes you have made to the codebase. this test impact analysis can even be used during the Team Builds run e.g. every night on a server, so you can have a lean and mean build that runs only impacted tests to verify regression on previous tests.&lt;/p&gt;  &lt;p&gt;When you create a new Unit test in a solution you also might notice that there is a second “testsettings” file created called “TraceAndTestImpact.testsettings”. this file contains all the settings to run a set of unit tests with the correct settings that enable test impact analysis.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.infosupport.com/aggbug.aspx?PostID=15951" width="1" height="1"&gt;</description><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/Team+System/default.aspx">Team System</category><category domain="http://blogs.infosupport.com/blogs/marcelv/archive/tags/Visual+Studio+2010/default.aspx">Visual Studio 2010</category><feedburner:origLink>http://blogs.infosupport.com/blogs/marcelv/archive/2009/05/22/how-to-enable-code-coverage-in-visual-studio-2010-unit-tests.aspx</feedburner:origLink></item></channel></rss>
