tag:blogger.com,1999:blog-28869391972914293602024-03-13T12:41:40.172-07:00Bill Wang's Blog让爱我的人为我骄傲Bill Wanghttp://www.blogger.com/profile/03863120660319844632noreply@blogger.comBlogger23125tag:blogger.com,1999:blog-2886939197291429360.post-56489260910361743972009-09-29T21:45:00.001-07:002009-09-29T21:45:54.381-07:00Tips on deploying TFS in a multi-domain environment<p>We have been asked about issues related to TFS in a multi-domain environment sporadically. I’m writing this post to share some basic knowledge in this scenario and wish you can benefit from it. Before you continue, please take a look at <a href="http://msdn.microsoft.com/en-us/library/ms253081.aspx">Trusts and Forests Considerations for Team Foundation Server</a>. </p> <p><strong></strong></p> <p><strong>Tip 1: The domain that the TFSSERVICE account is in needs to be trusted by user domains.</strong> </p> <p>TFS caches user accounts in its own databases. In certain conditions, TFS synchronizes cached accounts with AD. See my previous post <a href="http://billwg.blogspot.com/2008/12/tfs-service-account-requires-read.html">TFS service account requires read permission in user domains</a> for more information. For instance, you have a domain group Developers in AD. The Developers group is added to the Contributors group of a team project. You then added a new employee Jim to the Developers group. TFS considers Jim is in Contributors group only after a synchronization. </p> <p>TFS uses the TFSSERVICE account to synchronize user accounts. If your users accounts are from multiple domains, then the TFSSERVICE account needs to be authenticated by all user domains.  </p> <p><strong></strong></p> <p><strong>Tip2: When you add users of another domain to a TFS group, you need to log in to your computer with an account that is trusted by the other domain.</strong> </p> <p>Suppose you log in to your computer with DomainA\user1, and you plan to add DomainB\user2 to the Contributors group of a team project with Team Explorer. Then DomainA needs to be trusted by DomainB. Otherwise, you will not be able to specify DomainB\user2 in the Select Users dialogbox like the below:</p> <p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="SelectUser" border="0" alt="SelectUser" src="http://lh6.ggpht.com/_RC1R9QeaslU/SsLifuUBu8I/AAAAAAAAAbg/7beaY5ptPvc/SelectUser%5B6%5D.jpg?imgmax=800" width="465" height="249" /></p> Bill Wanghttp://www.blogger.com/profile/03863120660319844632noreply@blogger.com80tag:blogger.com,1999:blog-2886939197291429360.post-84767764067925014022009-08-03T03:09:00.001-07:002009-08-03T20:34:19.160-07:00Remove old shelvesets<p>Today a customer asked me how to clean up old shelvesets.The October 2008 release of TFS Power Tool contains Get-TfsShelveset and Remove-TfsShelveset cmdlets. The issue is that if one passes the result of Get-TfsShelveset to Remove-TfsShelveset with pipeline, the owner information is ignored and the Remove-TfsShelveset cmdlet will attempt to look up shelveset created by the current user. </p> <p>Fortunately, Remove-TfsShelveset recognizes owner in terms of “Remove-TfsShelveset –Shelveset name;domain\alias”. So one workaround is to first obtain a list of shelvesets with Get-TfsShelveset cmdlet, then computer the shelvesetspecs and invoke Remove-TfsShelveset understands. The below script will delete all shelvesets created before 90 days ago. </p> <pre class="csharpcode">Get-TfsShelveset -server http://170112m3:8080 -owner * | <br />Where-Object -Filter {$_.CreationDate <span class="preproc">-lt</span> [DateTime]::Now.AddDays(-90)} | <br />ForEach-Object -Process { Remove-TfsShelveset -server http://170112m3:8080 -Shelveset<br /> ($_.Name+<span class="str">";"</span>+$_.OwnerName) }</pre> Bill Wanghttp://www.blogger.com/profile/03863120660319844632noreply@blogger.com27tag:blogger.com,1999:blog-2886939197291429360.post-68445388337654950092009-07-15T01:30:00.001-07:002009-07-15T01:33:15.058-07:00VS Macro for deleting line numbers<p>When you copy code from internet and paste into Visual Studio, have you ever faced the trivial task to remove line numbers in the front of each line of code? I just wrote a macro to do this and I’d like to share it with you.</p> <p>When we past code into Visual Studio, it often looks like this:</p> <img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="MacroForRemovingLinenumber" border="0" alt="MacroForRemovingLinenumber" src="http://lh5.ggpht.com/_RC1R9QeaslU/Sl2USZZ2KJI/AAAAAAAAAbc/tNROpf_0Z_Y/MacroForRemovingLinenumber%5B5%5D.jpg?imgmax=800" width="696" height="328" /> <p>With this macro, we can remove line numbers very quickly. And the following is the script code. It will set the cursor to the start of current opened document, parse the first 3 characters of each line until the end of the document. </p> <pre class="csharpcode"> <span class="kwrd">Sub</span> DeleteLineNumber()<br /> <span class="kwrd">Dim</span> objSel <span class="kwrd">As</span> TextSelection = DTE.ActiveDocument.Selection<br /><br /> objSel.EndOfDocument()<br /> <span class="kwrd">Dim</span> endLine <span class="kwrd">As</span> <span class="kwrd">Integer</span> = objSel.ActivePoint.Line<br /> objSel.StartOfDocument()<br /><br /> <span class="kwrd">For</span> line = 1 <span class="kwrd">To</span> endLine<br /><br /> <span class="kwrd">For</span> bit = 1 <span class="kwrd">To</span> 3<br /> objSel.CharRight(<span class="kwrd">True</span>)<br /> <span class="kwrd">Dim</span> number <span class="kwrd">As</span> <span class="kwrd">Integer</span><br /> <span class="kwrd">If</span> <span class="kwrd">Integer</span>.TryParse(objSel.Text, number) <span class="kwrd">Then</span><br /> objSel.DeleteLeft()<br /> <span class="kwrd">End</span> <span class="kwrd">If</span><br /> <span class="kwrd">Next</span><br /><br /> objSel.LineDown()<br /> objSel.StartOfLine()<br /> <span class="kwrd">Next</span><br /><br /><span class="kwrd">End</span> <span class="kwrd">Sub</span></pre><br /><br /><p>To use this macro, you can </p><br /><br /><ol><br /> <li>Launch Visual Studio </li><br /><br /> <li>Press ALT+F8 to open Macro Explorer </li><br /><br /> <li>Expand MyMacros node in Macro Explorer </li><br /><br /> <li>Right click a module and select ‘New macro’ to create a new macro. </li><br /><br /> <li>Past in the script. </li><br /></ol><br /><br /><p>And there are several ways to run a macro. They are described in <a href="http://msdn.microsoft.com/en-us/library/a0003t62.aspx">How to: Run Macros</a>. If you find any issue or has any comment, please feel free to let me know</p> Bill Wanghttp://www.blogger.com/profile/03863120660319844632noreply@blogger.com23tag:blogger.com,1999:blog-2886939197291429360.post-80602949301226098742009-07-02T23:45:00.001-07:002009-07-02T23:58:02.399-07:00Install_Msxml6_Cpu32_Action failed when installing SQL Server 2008<table><tbody> <tr> <td> <p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="hfare" border="0" alt="hfare" align="left" src="http://lh3.ggpht.com/_RC1R9QeaslU/Sk2pFHRBplI/AAAAAAAAAbM/SsvGPtWaSdY/hfare%5B3%5D.jpg?imgmax=800" width="124" height="102" /> One of my friends was trying to setup a TFS 2010 environment, which requires SQL Server 2008 or above versions. We came across a SQL Server 2008 RTM bug, so I’m posting its description here so that other folks can work around it too. </p> <div></div> </td> </tr> <tr> <td> <p><strong>Symptoms</strong></p> <p>The installation wizard of SQL Server 2008 fails at the point of starting the SQL Server browser service. In the detailed installation log of SQL Server, which locates in %ProgramFiles%\Microsoft SQL Server\100\Setup Bootstrap\LOG\, there are error messages like the following. <a href="http://msdn.microsoft.com/en-us/library/ms143702.aspx">See How to: View SQL Server Setup Log Files</a> for more information about log location. </p> <p>2009-07-01 16:19:19 Slp: Checkpoint: INSTALL_MSXML6_CPU32_ACTION <br />2009-07-01 16:19:19 Slp: Completed Action: Install_Msxml6_Cpu32_Action, returned False <br />2009-07-01 16:19:19 Slp: Error: Action "Install_Msxml6_Cpu32_Action" failed during execution. <br />2009-07-01 16:19:19 Slp: Action "Install_sql_engine_core_shared_Cpu32_Action" will return false due to the following conditions:</p> <p><strong></strong></p> <p><strong>Cause</strong></p> <p>This is a SQL Server 2008 RTM installation bug. The installation wizard has a conflict with MSXML6 SP2 (KB954459). </p> <p><strong></strong></p> <p><strong>Workaround</strong></p> <ol> <li>Remove KB954459 </li> <li>Uninstall SQL Server 2008. </li> <li>Reboot  the computer.</li> <li>Install SQL Server 2008.</li> </ol> </td> </tr> </tbody></table> Bill Wanghttp://www.blogger.com/profile/03863120660319844632noreply@blogger.com9tag:blogger.com,1999:blog-2886939197291429360.post-8418767967193511452009-06-25T23:31:00.001-07:002009-06-26T19:11:14.487-07:00Moving Reporting Service in a TFS 2008 environment<p>On MSDN, we have documents for moving TFS database, moving Analysis Service database etc. But it’s not covered to move Reporting Service. </p> <p>After I sent this question to our internal discussion group. I received a couple of replies. Especially thank <a href="http://blogs.msdn.com/ablock/">Aaron Block</a>, <a href="http://social.msdn.microsoft.com/Profile/en-US/?user=Bill%20Essary%20MSFT">Bill Essary</a> and <a href="http://blogs.msdn.com/lakhminder/default.aspx">Lakhminder Singh</a> for their great help. Here are the steps to move RS. </p> <ol> <li>Follow <a href="http://support.microsoft.com/default.aspx/kb/842425">KB 842425</a> to move RS DB to a new instance. </li> <li>Ensure that you have a login for the TFS Reports account, in case your RS databases are now going to be hosted on a different SQL instance. The login for the RS database should have RSExecRole in Report Server databases (which it should retain when you restore the RS databases.) </li> <li>Create new data connections for TfsReportsDS and TfsOlapReportsDS. They can be modified via <a href="http://ReportingService/Reports">http://ReportingService/Reports</a>. </li> <li>Run TfsAdminUtil ConfigureConnections command to update setting /ReportsUri and /ReportServerUri.  Consider <a href="http://support.microsoft.com/kb/959126">http://support.microsoft.com/kb/959126</a> while doing it. </li> <li>Copy TfsConfigWss.exe to the SharePoint server and run it there to update the reports redirector. </li> <li>In the installation folder of TFS, there’s a folder named “Microsoft Visual Studio 2008 Team Foundation Server - ENU”. Update the MSIProperty.ini in that folder and change the RS machine name for the VSTF_RS_SERVER property. You just need to give new machine\server name for RS & do not give the instance name. Optionally update the VSTF_RS_REPORTS_URI, & VSTF_RS_REPORTSERVER_URI properties. See <a href="http://msdn.microsoft.com/en-us/library/bb909697.aspx">Msiproperty.ini File Properties</a> for more information. </li> </ol> Bill Wanghttp://www.blogger.com/profile/03863120660319844632noreply@blogger.com11tag:blogger.com,1999:blog-2886939197291429360.post-38415966697355485262009-06-20T04:53:00.001-07:002009-09-29T21:49:45.159-07:00Testing WCF web services<p>This post is for refining my previous post <a href="http://billwg.wordpress.com/2008/10/31/test-wcf-web-service-hosted-in-aspnet-development-server/">Test WCF web service – Hosted in ASP.NET Development Server</a>. Personally, I prefer Wordpress because it is easy to maintain layout. But all blogs at wordpress.com are censored by the Great Firewall of China (I always want to say the word that has 4 characters, starts with “F” and ends with “K” when talking about it). So I decided to continue to blog in BlogSpot. </p> <p>I started working in Microsoft Shanghai Global Technical Support Center on May 5th 2008. Fortunately, the company has a private line connecting to the USA thus we can bypass the Great Firewall in the office. My friends and I have dreamed this all our lives. When I wrote the previous post about testing WCF web service, I just had several weeks of experience in VSTT, so forgive me for not having made it easy to read. Since published that post, I have received many feedbacks, thank you all! It’s time to refine the post. </p> <p>I remember last year the MSDN document at <a title="http://msdn.microsoft.com/en-us/library/ms243399.aspx" href="http://msdn.microsoft.com/en-us/library/ms243399.aspx">http://msdn.microsoft.com/en-us/library/ms243399.aspx</a> was the same as that in <a title="http://msdn.microsoft.com/en-us/library/ms243399(VS.80).aspx" href="http://msdn.microsoft.com/en-us/library/ms243399(VS.80).aspx">http://msdn.microsoft.com/en-us/library/ms243399(VS.80).aspx</a>. Then Microsoft has changed the terminology about unit test. It is said that hosting a web service and actually invoking it over HTTP in a test method is considered to be “integration test”, while creating an instance of the web service class in a test method and invoking it’s methods is the “unit test”. So I guess the topic of this post is about how to host WCF web services and perform integration testing. </p> <p>I focus on testing WCF web services that are hosted in ASP.NET Deployment Server (Cassini). </p> <p><strong>Background about ASP.NET unit testing.</strong></p> <p>Let me explain some background about ASP.NET unit testing. ASP.NET unit tests can (not always) be executed in the same process as the web server. See <a href="http://msdn.microsoft.com/en-us/library/ms182520.aspx">Overview of ASP.NET Unit Tests</a> for more information. At run time of executing ASP.NET unit tests, it goes through the following steps:</p> <ol> <li>Backup your web.config to web.config.backup. </li> <li>Register an HTTP module Microsoft.VisualStudio.TestTools.HostAdapter.Web.HttpModule, which is in %Program Files%\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.QualityTools.HostAdapters.ASPNETAdapter. to the web.config. </li> <li>Start ASP.NET Deployment Server if it is used. </li> <li>Send a request to the URL pointed by UrlToTest attribute of your test method. </li> <li>The registered Microsoft.VisualStudio.TestTools.HostAdapter.Web.HttpModule is triggered by the web server. The module subscribes the PageLoad event of the requested page. When PageLoad event is fired, it loads the test assembly in to the web server process and execute the test method. </li> <li>Restore the web.config and delete web.config.backup after tests complete. </li> </ol> <p>ASP.NET Deployment Server is started when running a unit test if one of the following 2 conditions is meet: </p> <ol> <li>AspNetDeploymentServer attribute is specified. <br />This attributes tells VS to start Cassini before executing the test method. Both AspNetDeploymentServer and AspNetDeploymentServerHost expects a physical path to the web application. In a team environment, the web site is usually located in different directories in different computers. The workaround is to use environment variables. See <a href="http://msdn.microsoft.com/en-us/library/ms243136(VS.80).aspx">Testing Web Sites and Web Services in a Team Environment</a> for more information.  </li> <li>UrlToTest and HostType and  AspNetDeploymentServerHost attributes are all specified. <br />UrlToTest attribute is required if HostType attribute is set to “ASP.NET”. The combination of the 3 attributes let VS know ASP.NET Deployment Server should be started and the test method should be executed in the same process as the web server. </li> </ol> <p>When testing web services, we usually want to invoke the web services from a proxy and it’s not necessary to execute test methods in the same process as the web server. Therefore, we don’t need to UrlToTest, HostType and AspNetDeploymentServerHost attributes. </p> <p><strong>Testing WCF web services hosted in ASP.NET Deployment Server</strong></p> <p>I go through the process of creating a WCF project and add a test method to demonstrate this scenario. Several sentences here are copied from <a title="http://msdn.microsoft.com/en-us/library/ms243399(VS.80).aspx" href="http://msdn.microsoft.com/en-us/library/ms243399(VS.80).aspx">http://msdn.microsoft.com/en-us/library/ms243399(VS.80).aspx</a>.</p> <ol> <li>Create a WCF project in VS via File->New->Project->Visual C#->Web->WCF Service Application. </li> <li>Generate unit tests against the Web service in the standard way for generating unit tests. For more information, see <a href="http://msdn.microsoft.com/en-us/library/ms182524(VS.80).aspx">How to: Generate a Unit Test</a>. </li> <li>Use <a href="http://msdn.microsoft.com/en-us/library/aa347733.aspx">svcutil</a> to generate WCF web service proxy. <ol> <li>Right click the Service1.svc in the WCF project in Solution Explorer and select <strong>View in Browser</strong>. </li> <li>Run <strong>svcutil </strong><a href="http://localhost:52747/Service1.svc"><strong>http://localhost:52747/Service1.svc</strong></a><strong> /config:app.config /out:Service1Proxy.cs /language:C#</strong> to generate proxy and config file. Please replace the URL of Service1.svc to that was displayed in the address bar of the browser in #1. </li> <li>Add Service1Proxy.cs and app.config to the test project. </li> </ol> </li> <li>Remove the attribute HostType, UrlToTest and AspNetDeploymentServerHost for the generated test method. </li> <li>Add the <a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.unittesting.web.aspnetdevelopmentserverattribute(VS.80).aspx">AspNetDevelopmentServerAttribute</a> attribute to the unit test. The arguments for this attribute class point to the site of the Web service and name the server. For more information, see <a href="http://msdn.microsoft.com/#AccessToASPNETDevServer">Ensuring Access to ASP.NET Development Server</a>. </li> <li>Change the test method to use the generated proxy class to invoke the web service and add the redirection logic. The test class will look like the following. <strong></strong></li> </ol> <table><tbody> <tr> <td><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="DownloadIcon" border="0" alt="DownloadIcon" align="left" src="http://lh4.ggpht.com/_RC1R9QeaslU/SjzNz30QyII/AAAAAAAAAbE/hjCm-qF5YpY/DownloadIcon_thumb%5B1%5D.jpg?imgmax=800" /></td> <td><a href="http://cid-d39688ac05a57561.skydrive.live.com/self.aspx/Reference/MyServices.zip">sample project</a> </td> </tr> </tbody></table> I also paste some code here to ease reverences. <p><strong>WcfWebServiceHelper.cs</strong></p> <pre class="csharpcode"><span class="kwrd">using</span> System;<br /><span class="kwrd">using</span> System.Reflection;<br /><span class="kwrd">using</span> System.ServiceModel.Description;<br /><span class="kwrd">using</span> System.ServiceModel;<br /><span class="kwrd">using</span> Microsoft.VisualStudio.TestTools.UnitTesting;<br /><br /><span class="kwrd">namespace</span> TestProject1<br />{<br /> <span class="kwrd">class</span> WcfWebServiceHelper<br /> {<br /> <span class="kwrd">public</span> <span class="kwrd">static</span> <span class="kwrd">bool</span> TryUrlRedirection(<span class="kwrd">object</span> client, TestContext context, <span class="kwrd">string</span> identifier)<br /> {<br /> <span class="kwrd">bool</span> result = <span class="kwrd">true</span>;<br /> <span class="kwrd">try</span><br /> {<br /> PropertyInfo property = client.GetType().GetProperty(<span class="str">"Endpoint"</span>);<br /> <span class="kwrd">string</span> webServer = context.Properties[<br /> <span class="kwrd">string</span>.Format(<span class="str">"AspNetDevelopmentServer.{0}"</span>, identifier)].ToString();<br /> Uri webServerUri = <span class="kwrd">new</span> Uri(webServer);<br /> ServiceEndpoint endpoint = (ServiceEndpoint)property.GetValue(client, <span class="kwrd">null</span>);<br /><br /> EndpointAddressBuilder builder = <span class="kwrd">new</span> EndpointAddressBuilder(endpoint.Address);<br /> builder.Uri = <span class="kwrd">new</span> Uri(<br /> endpoint.Address.Uri.OriginalString.Replace(<br /> endpoint.Address.Uri.Authority, webServerUri.Authority));<br /><br /> endpoint.Address = builder.ToEndpointAddress();<br /><br /> }<br /> <span class="kwrd">catch</span> (Exception e)<br /> {<br /> context.WriteLine(e.Message);<br /> result = <span class="kwrd">false</span>;<br /> }<br /> <span class="kwrd">return</span> result;<br /> }<br /><br /> }<br />}</pre><br /><br /><p><strong>Test Method</strong></p><br /><br /><pre class="csharpcode"> [TestMethod()]<br /> [AspNetDevelopmentServer(<span class="str">"WcfService1"</span>, <br /> <span class="str">"C:\\Users\\Administrator\\Desktop\\TfsRoot\\BuildTest\\Main\\MyServices\\WcfService1"</span>)]<br /> <span class="kwrd">public</span> <span class="kwrd">void</span> GetDataTest()<br /> {<br /> Service1Client target = <span class="kwrd">new</span> Service1Client();<br /> Assert.IsTrue(WcfWebServiceHelper.TryUrlRedirection(target,TestContext,<span class="str">"WcfService1"</span>));<br /> <span class="kwrd">int</span> <span class="kwrd">value</span> = 0; <br /> <span class="kwrd">string</span> expected = <span class="str">"You entered: 0"</span>; <br /> <span class="kwrd">string</span> actual;<br /> actual = target.GetData(<span class="kwrd">value</span>);<br /> Assert.AreEqual(expected, actual);<br /> }</pre> Bill Wanghttp://www.blogger.com/profile/03863120660319844632noreply@blogger.com247tag:blogger.com,1999:blog-2886939197291429360.post-2912503702155639362009-06-12T00:53:00.001-07:002009-06-12T01:05:19.460-07:00How to: Initialize a WorkItem instance for the changed work item in WorkItemChangedEvent handler<p>Recently I’ve been asked about several questions that need to initialize a WorkItem instance in the web service handler for WorkItemChangedEvent. So I paste a sample code here to ease the future references. </p> <p>One thing to note is that in order to query work items, the identity for the app pool that hosts the web service in IIS must has property permission granted. In TFS 2005 and 2008, work item permissions are based on area and iteration. See <a href="http://msdn.microsoft.com/en-us/library/ms252587.aspx">Team Foundation Server Permissions</a> for more information. </p> <pre class="csharpcode"><span class="kwrd">using</span> System;<br /><span class="kwrd">using</span> System.Diagnostics;<br /><span class="kwrd">using</span> System.Web.Services;<br /><span class="kwrd">using</span> System.Web.Services.Protocols;<br /><span class="kwrd">using</span> System.Xml;<br /><span class="kwrd">using</span> Microsoft.TeamFoundation.Client;<br /><span class="kwrd">using</span> Microsoft.TeamFoundation.WorkItemTracking.Client;<br /><br /><span class="kwrd">namespace</span> EventHandler<br />{<br /> <span class="rem">/// <summary></span><br /> <span class="rem">/// Summary description for Service1</span><br /> <span class="rem">/// </summary></span><br /> [WebService(Namespace = <span class="str">"http://tempuri.org/"</span>)]<br /> [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]<br /> [System.ComponentModel.ToolboxItem(<span class="kwrd">false</span>)]<br /> <span class="rem">// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. </span><br /> <span class="rem">// [System.Web.Script.Services.ScriptService]</span><br /> <span class="kwrd">public</span> <span class="kwrd">class</span> WorkItemChangedEventHandler : System.Web.Services.WebService<br /> {<br /><br /> [SoapDocumentMethod(<br /> Action = <span class="str">"http://schemas.microsoft.com/TeamFoundation/2005/06/Services/Notification/03/Notify"</span>,<br /> RequestNamespace = <span class="str">"http://schemas.microsoft.com/TeamFoundation/2005/06/Services/Notification/03"</span>)]<br /> [WebMethod]<br /> <span class="kwrd">public</span> <span class="kwrd">void</span> Notify(<span class="kwrd">string</span> eventXml)<br /> {<br /> <span class="kwrd">try</span><br /> {<br /> <span class="kwrd">string</span> tfsUrl = <span class="str">"http://TFS_AT:8080"</span>;<br /> TeamFoundationServer tfs = TeamFoundationServerFactory.GetServer(tfsUrl);<br /><br /> var workItemId = GetWorkItemID(eventXml);<br /><br /> var wis = (WorkItemStore)tfs.GetService(<span class="kwrd">typeof</span>(WorkItemStore));<br /> var wi = wis.GetWorkItem(workItemId);<br /><br /><br /> }<br /> <span class="kwrd">catch</span> (Exception e)<br /> {<br /> var eventSource = <span class="str">"My WorkItemChangedEvent Handler"</span>;<br /> var logName = <span class="str">"Application"</span>;<br /> var machineName = <span class="str">"."</span>; <span class="rem">//local computer.</span><br /><br /> <span class="kwrd">if</span> (!EventLog.SourceExists(eventSource, machineName))<br /> {<br /> var eventObj = <span class="kwrd">new</span> EventSourceCreationData(eventSource, logName);<br /> EventLog.CreateEventSource(eventObj);<br /> }<br /><br /> var eventLog = <span class="kwrd">new</span> EventLog(logName, machineName, eventSource);<br /> eventLog.WriteEntry(e.Message);<br /> }<br /> }<br /><br /> <span class="kwrd">private</span> <span class="kwrd">int</span> GetWorkItemID(<span class="kwrd">string</span> eventXml)<br /> {<br /> var doc = <span class="kwrd">new</span> XmlDocument();<br /> doc.LoadXml(eventXml);<br /> var path = <span class="str">"/WorkItemChangedEvent/CoreFields/IntegerFields/Field[ReferenceName='System.Id']/NewValue"</span>;<br /> var node = doc.SelectSingleNode(path);<br /><br /> var id = <span class="kwrd">int</span>.Parse(node.InnerText);<br /> <span class="kwrd">return</span> id;<br /> }<br /><br /> }<br />}</pre> Bill Wanghttp://www.blogger.com/profile/03863120660319844632noreply@blogger.com3tag:blogger.com,1999:blog-2886939197291429360.post-40682931894214505792009-05-28T00:27:00.001-07:002009-05-28T00:27:37.412-07:00"TFSServerScheduler" Service does not start automatically at system startup<p>Recently I have been working on a case about Visual Studio Team Foundation Server Task Scheduler service. A customer reported that in a single server TFS 2008 deployment,  when TFS server is rebooted, TFSServerScheduler doesn’t start automatically. Instead, there’s an error message in Windows Event Log:</p> <blockquote> <p>Source: "TFS Scheduler" </p> <p>TF53010: The following error has occurred in a Team Foundation component or <br />extension: <br />Date (UTC): 20.05.2009 08:16:35 <br />Machine: xxx <br />Application Domain: TFSServerScheduler.exe <br />Assembly: Microsoft.TeamFoundation.Common, Version=9.0.0.0, Culture=neutral, <br />PublicKeyToken=b03f5f7f11d50a3a; v2.0.50727 <br />Process Details:  <br />Process Name: TFSServerScheduler  <br />Process Id: 2920  <br />Thread Id: 3092  <br />Account name: domain\user </p> <p>Detailed Message: Unable to connect to the remote server</p> </blockquote> <p>The interesting thing is that when you try to start TFSServerScheduler service manually, it starts successfully and everything works fine! </p> <p>After some digging, we eventually came to <a href="http://blogs.msdn.com/dstfs/archive/2008/07/09/fun-with-the-tfsserverscheduler-service.aspx">Fun with the TFSServerScheduler service</a>. In that post, it says TFSServerScheduler depends on SQL Server service in a single server TFS deployment. If SQL Server starts slower than TFSServerScheduler, then TFSServerScheduler will crash and exit. </p> <p>In my case however, it is a bit different. it turns out TFSServerScheduler also depends on World Wide Web Publishing Service (W3SVC). You can verify this by stopping W3SVC, then restart TFSServerScheduler. TFSServerScheduler can be started but will exit after several seconds. The same error message as I posted will be added to Windows Event Log. </p> <p>You might have already figured out the workaround. We can configure TFSServerScheduler to depend on W3SVC. One approach is to run command: <strong>sc config TFSServerScheduler depend= W3SVC</strong>. Please note that there’s a space between the equal sign and W3SVC. Then open the property dialog for TFSServerScheduler and check if its dependency is configured correctly. </p> <p>I can’t say for sure which services are actually dependent by TFSServerScheduler. But I believe we can find them out if we meet similar issues in the future. </p> Bill Wanghttp://www.blogger.com/profile/03863120660319844632noreply@blogger.com5tag:blogger.com,1999:blog-2886939197291429360.post-8998278449063189172009-05-06T15:33:00.001-07:002009-05-06T15:33:37.625-07:00Have attended my first event in TeamSystemLive<p><a href="http://www.teamsystemlive.com/">TeamSystemLive</a> is a great social network created by <a href="http://www.teamsystemlive.com/profile/ChrisTullier">Chris Tullier</a>. There are a lot of people who use TFS every day there. Until now, I only know several professional TFS administrators in China. TeamSystemLive gives me a great many of opportunities to talk with TFS experts and exchange knowledge. </p> <p>Today I attended my first event in TeamSystemLive. It was <a href="http://www.teamsystemlive.com/events/teamsystemlivecom-chat-wix-and">TeamSystemLive.com Chat: WiX and Team Build Together at Last</a> which is presented by <a href="http://blogs.teamsystemnotes.com/">William Bartholomew</a>. William gave us an excellent demonstration about how to build an MSI package with WIX. He will  give us another 3 talks about team build. Please refer to <a href="http://blogs.teamsystemnotes.com/2009/05/06/may-is-build-month-on-teamsystemlivecom/">May is Build Month on TeamSystemLive.com</a> for more information. Don’t miss them!</p> Bill Wanghttp://www.blogger.com/profile/03863120660319844632noreply@blogger.com3tag:blogger.com,1999:blog-2886939197291429360.post-12873983377356316342009-04-23T03:52:00.001-07:002009-04-23T04:00:25.116-07:00How to: Modify a project portal site template<p>We have received a few requests for how to modify the default team project settings recently. So I’m writing this post to share the steps of modifying a site template. </p> <p>As we already know, when we create a new team project, the corresponding portal in SharePoint is also created. The portal is created with the SharePoint template referenced in the process template. After we download a process template, we can open the WssTasks.XML. Then we will find a <site> element which specifies the SharePoint site template and language id. Until now, the SharePoint site template can not be edited in the Process Editor from TFS power tool. </p> <p>When TFS is installed, the SharePoint site templates for MSF for Agile and MSF for CMMI are uploaded to SharePoint. You can find these template in %ProgramFiles%\Microsoft Visual Studio 2008 Team Foundation Server\Tools\Templates. The below steps are for how to modify the portal site template. The MSFAgile.stp is for WSS 2.0 and MSFAgile30.stp is for WSS 3.0.</p> <p><strong>Configure an existing team portal and save the portal as an template.</strong> </p> <ol> <li>Open an existing team portal and modify settings such as time zone. </li> <li>In the portal, click Site Actions<strong>-></strong>Site Settings->Save site as template. </li> <li>Since the process template already contains the default document libraries, so we uncheck the <strong>Include Content</strong> checkbox. </li> <li>Click <strong>OK</strong> and MyTemplate is created in Site Template Gallery. </li> <li>Go to Site Actions<strong>-></strong>Site Settings->Site templates and download MyTemplate.stp to a local folder. </li> </ol> <p><strong>Sometimes, you need to modify the MyTemplate.stp manually. Skip these steps if you don’t need to do that.</strong></p> <ol> <li>Install <a href="http://support.microsoft.com/kb/310618">Microsoft Cabinet Software Development Kit</a>. The portal template for a team project is just cab files. We can use the CABARC.EXE in the SDK to extract and recreate the template files. </li> <li>Login the TFS server and navigate to %ProgramFiles%\Microsoft Visual Studio 2008 Team Foundation Server\Tools\Templates. </li> <li>Find the template you want to modify. Make a back up of it and change the extension from .stp to .cab. Then you can open the .cab file with Windows Explorer. Copy all contents to a folder, say C:\TemplateExtract. <p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="TemplateExtract2" border="0" alt="TemplateExtract2" src="http://lh3.ggpht.com/_RC1R9QeaslU/SfBIbsBE8tI/AAAAAAAAAZc/iIyx3zG8CcU/TemplateExtract2%5B4%5D.jpg?imgmax=800" width="521" height="234" /></p> </li> <li>Modify the settings in the manefist.xml based on your requirement and save. </li> <li>Recreate the .stp template file with CABARC.EXE. For example: <strong>CABARC N “C:\MyTemplate.stp C:\TemplateExtract\*.*”</strong>, then MyTemplate.stp should be created in C: drive. <p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="addTemplate2" border="0" alt="addTemplate2" src="http://lh4.ggpht.com/_RC1R9QeaslU/SfBIcPGXH2I/AAAAAAAAAZg/WMb2scbzSUE/addTemplate2%5B4%5D.jpg?imgmax=800" width="677" height="339" /></p> </li> </ol> <p><strong>Upload the portal site template to SharePoint.</strong> </p> <ol> <li>List the global template with <a href="http://technet.microsoft.com/en-us/library/cc263342.aspx">stsadm -o enumtemplates</a>. stsadm.exe is usually located in %ProgramFiles%\common files\microsoft shared\web server extensions\12\bin. Remember the tile of the site template you want to modify. <p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="enumtemplate" border="0" alt="enumtemplate" src="http://lh5.ggpht.com/_RC1R9QeaslU/SfBIdjj-pxI/AAAAAAAAAZk/0q6cKWNQ5bQ/enumtemplate4.jpg?imgmax=800" width="669" height="262" /></p> </li> <li>If you want to add a new template, you can skip this step. If you want to update and existing site template, you need to first delete the old template with <a href="http://technet.microsoft.com/en-us/library/cc263068.aspx">stsadm –o deletetemplate</a> and then upload the template with the same title. For example: <strong>stsadm –o deletetemplate –title VSTS_MSFAgile</strong>. <p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="deleteTemplate" border="0" alt="deleteTemplate" src="http://lh3.ggpht.com/_RC1R9QeaslU/SfBIeFGeISI/AAAAAAAAAZo/XvhiKfmvSo0/deleteTemplate4.jpg?imgmax=800" width="666" height="218" /></p> </li> <li>Add the template with <a href="http://technet.microsoft.com/en-us/library/cc261822.aspx">stsadm –o addtemplate</a> command. For example: <strong>stsadm –o addtemplate –filename C:\MyTemplate.stp –title VSTS_MSFAgile</strong>. Since a process template references the site template by template title. If you are replacing an existing template, make sure the title is the same as displayed when run enumtemplates in the previous step. <p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="AddTemplate4" border="0" alt="AddTemplate4" src="http://lh5.ggpht.com/_RC1R9QeaslU/SfBIeoImEDI/AAAAAAAAAZs/5mvF627MWgE/AddTemplate4%5B5%5D.jpg?imgmax=800" width="670" height="130" /></p> </li> <li>Run iisreset to restart the IIS. </li> </ol> <p>Finally, you can create a new team project to test the newly uploaded site template. </p> Bill Wanghttp://www.blogger.com/profile/03863120660319844632noreply@blogger.com8tag:blogger.com,1999:blog-2886939197291429360.post-63574887582998452182009-04-22T03:15:00.001-07:002009-04-22T03:28:10.975-07:00How to: Enable tracing of TFS add-ins for Excel and MS Project<p>TFS provides abilities to manage work items in Excel and MS Project. When you experience unexpected behaviors while managing work items in Excel or MS Project, one approach to diagnose this issue is to enable tracing. The trace log can give us more information and probably contains clues. </p> <ol> <li>Create a file EXCEL.exe.config to enable tracing of Excel (WINPROJ.exe.config for MS Project). </li> <li>Add the below content to the config file and save. <pre class="csharpcode"><span class="kwrd"><?</span><span class="html">xml</span> <span class="attr">version</span> <span class="kwrd">="1.0"</span>?<span class="kwrd">></span><br /><span class="kwrd"><</span><span class="html">configuration</span><span class="kwrd">></span><br /> <span class="kwrd"><</span><span class="html">system.diagnostics</span><span class="kwrd">></span><br /> <span class="kwrd"><</span><span class="html">trace</span> <span class="attr">autoflush</span><span class="kwrd">="true"</span> <span class="attr">indentsize</span><span class="kwrd">="4"</span><span class="kwrd">></span><br /> <span class="kwrd"><</span><span class="html">listeners</span><span class="kwrd">></span><br /> <span class="kwrd"><</span><span class="html">add</span> <span class="attr">name</span><span class="kwrd">="myListener"</span> <span class="attr">type</span><span class="kwrd">="System.Diagnostics.TextWriterTraceListener"</span><br /> <span class="attr">initializeData</span><span class="kwrd">="c:\Logs\Excel.log"</span> <span class="kwrd">/></span><br /> <span class="kwrd"></</span><span class="html">listeners</span><span class="kwrd">></span><br /> <span class="kwrd"></</span><span class="html">trace</span><span class="kwrd">></span><br /> <span class="kwrd"><</span><span class="html">switches</span><span class="kwrd">></span><br /> <span class="kwrd"><</span><span class="html">add</span> <span class="attr">name</span><span class="kwrd">="General"</span> <span class="attr">value</span><span class="kwrd">="4"</span> <span class="kwrd">/></span><br /> <span class="kwrd"></</span><span class="html">switches</span><span class="kwrd">></span><br /> <span class="kwrd"></</span><span class="html">system.diagnostics</span><span class="kwrd">></span><br /><span class="kwrd"></</span><span class="html">configuration</span><span class="kwrd">></span></pre><br /> </li><br /><br /> <li>Go to the folder where EXCEL.exe or WINPROJ.exe locate. For Office 2007, they are in %\ProgramFiles%\Microsoft Office\Office12. </li><br /><br /> <li>Copy the EXCEL.exe.config or WINPROJ.exe.config there. </li><br /><br /> <li>Restart Excel or MS Project. When you use functions in the TFS add-in, trace logs should be created. </li><br /></ol> Bill Wanghttp://www.blogger.com/profile/03863120660319844632noreply@blogger.com3tag:blogger.com,1999:blog-2886939197291429360.post-76890633099448062192009-04-17T20:05:00.001-07:002009-04-17T20:05:21.046-07:00How to: Upgrade TFS data tier to SQL Server 2008<p>Many customers asked about how to upgrade the TFS DT to SQL Server 2008. I’m writing this post  in the hope of that other TFS administrators can get a quick help. The following are steps to upgraded the TFS DT:</p> <ol> <li>Apply TFS 2008 SP1 if you haven’t applied it yet. TFS 2008 SP1 is a must in order to work with SQL Server 2008. </li> <li>Follow the document <a href="http://msdn.microsoft.com/en-us/library/ms144267.aspx">How to: Upgrade to SQL Server 2008 (Setup)</a> to upgrade the database. </li> <li>Open the installation folder of TFS, find the configuration file Web Services\Warehouse\web.config. </li> <li>Modify the assembly binding redirection of Microsoft.AnalysisServices from <bindingRedirect oldVersion="9.0.242.0" newVersion="9.0.242.0"/> to <bindingRedirect oldVersion="9.0.242.0" newVersion="10.0.0.0"/>.</li> <li>Perform the step #4 for the Toos\SetupWarehouse.exe.config and Toos\TfsAdminUtil.exe.config.</li> <li>If some reports from the default MSF for Agile or MSF for CMMI template don’t work after the database upgrade, you might want to look at <a href="http://blogs.msdn.com/dstfs/archive/2009/03/11/issues-with-tfs-2008-built-in-reports-using-sql-server-reporting-services-2008.aspx">Issues with TFS 2008 built-in reports using SQL Server Reporting Services 2008</a>.  </li> </ol> Bill Wanghttp://www.blogger.com/profile/03863120660319844632noreply@blogger.com8tag:blogger.com,1999:blog-2886939197291429360.post-39431072889456943942009-04-08T02:55:00.001-07:002009-04-08T02:58:12.465-07:00Test ID should be used when running MSTest.exe with /unique switch<p>The MSDN document <a href="http://msdn.microsoft.com/en-us/library/ms182489.aspx">MSTest.exe Command-Line Options</a> describes the usage of MSTest. It has a /unique switch. If you follow the demo in the document to use /unique switch, you might get the error message “<em>Test MethodTest1 is not unique. It maps to more than one test.</em>”.</p> <p>In Visual Studio, a test method has an ID. To get the test ID, you can </p> <ol> <li>Select a test in the Test View window. </li> <li>Press F4 to open the Property Window. </li> <li>Find the ID field in the Property Window. </li> </ol> <p>For unit test, the test ID is made up of namespace.class.testmethod. For coded web test, the ID is made up of namespace.class. When MSTest.exe is run with /unique switch, test ID should be passed to /test switch. For example: <strong>MSTest  /testcontainer:TestProject1.dll /test:TestProject1.Class1Test.TestMethod1 /unique</strong>.</p> Bill Wanghttp://www.blogger.com/profile/03863120660319844632noreply@blogger.com4tag:blogger.com,1999:blog-2886939197291429360.post-79996417300267100572009-04-07T02:14:00.001-07:002009-04-16T19:48:14.016-07:00Can’t synchronize TFS warehouse after upgrading SQL Server to 2008<p>A few days ago, I upgraded the database of my TFS from SQL Server 2005 to 2008. Then the warehouse of TFS can’t be synchronized. Finally, I got time to troubleshoot this issue today. </p> <p><strong>Symptoms</strong></p> <p>I tried to invoke the web service <a href="http://TfsServer:8080/Warehouse/v1.0/warehousecontroller.asmx?op=Run">http://TfsServer:8080/Warehouse/v1.0/warehousecontroller.asmx?op=Run</a> to synchronize the warehouse, then an 6 error message were logged in the Windows Event Log immediately in TFS server. One of them looks like this:</p> <p><em>Detailed Message: Cube processing runtime error: \r\nMicrosoft.TeamFoundation.Server.AnalysisServiceConnectionException: Error encountered when creating connection to Analysis Services. Contact your Team Foundation Server administrator. ---> Microsoft.AnalysisServices.ConnectionException: Cannot connect to Analysis Services version '10.0.1600.22'. <br />   at Microsoft.AnalysisServices.Server.Connect(String connectionString, String sessionId) <br />   at Microsoft.AnalysisServices.Server.Connect(String connectionString) <br />   at Microsoft.TeamFoundation.Warehouse.OlapCreator.GetServerEdition() <br />   --- End of inner exception stack trace --- <br />   at Microsoft.TeamFoundation.Warehouse.OlapCreator.GetServerEdition() <br />   at Microsoft.TeamFoundation.Warehouse.OlapCreator.CommonInit() <br />   at Microsoft.TeamFoundation.Warehouse.OlapCreator..ctor(String serverName, String databaseName, String relationalConnectionString) <br />   at Microsoft.TeamFoundation.Warehouse.AdapterScheduler.RunCubeProcess()</em></p> <p>The other 5 error messages were similar to this one. I list their error message without call stacks here so that people can reach to this post so no matter which error message is used as the keyword to search, . </p> <ol> <li><em>Detailed Message: Failed to load adapter Microsoft.VisualStudio.TestTools.WarehouseAdapter.Adapter. Exception Info: \n Microsoft.TeamFoundation.Server.AnalysisServiceConnectionException: Error encountered when creating connection to Analysis Services. Contact your Team Foundation Server administrator. ---> Microsoft.AnalysisServices.ConnectionException: Cannot connect to Analysis Services version '10.0.1600.22'.</em> </li> <li><em>Detailed Message: Failed to load adapter Microsoft.TeamFoundation.WorkItemTracking.Adapter.Adapter. Exception Info: \n Microsoft.TeamFoundation.Server.AnalysisServiceConnectionException: Error encountered when creating connection to Analysis Services. Contact your Team Foundation Server administrator. ---> Microsoft.AnalysisServices.ConnectionException: Cannot connect to Analysis Services version '10.0.1600.22'.</em> </li> <li><em>Detailed Message: Failed to load adapter Microsoft.TeamFoundation.VersionControl.Adapter.VCAdapter. Exception Info: \n Microsoft.TeamFoundation.Server.AnalysisServiceConnectionException: Error encountered when creating connection to Analysis Services. Contact your Team Foundation Server administrator. ---> Microsoft.AnalysisServices.ConnectionException: Cannot connect to Analysis Services version '10.0.1600.22'.</em> </li> <li><em>Detailed Message: Failed to load adapter Microsoft.TeamFoundation.Build.Adapter.TeamBuildAdapter. Exception Info: \n Microsoft.TeamFoundation.Server.AnalysisServiceConnectionException: Error encountered when creating connection to Analysis Services. Contact your Team Foundation Server administrator. ---> Microsoft.AnalysisServices.ConnectionException: Cannot connect to Analysis Services version '10.0.1600.22'.</em> </li> <li><em>Detailed Message: Failed to load adapter Microsoft.TeamFoundation.Warehouse.CommonStructureAdapter. Exception Info: \n Microsoft.TeamFoundation.Server.AnalysisServiceConnectionException: Error encountered when creating connection to Analysis Services. Contact your Team Foundation Server administrator. ---> Microsoft.AnalysisServices.ConnectionException: Cannot connect to Analysis Services version '10.0.1600.22'.</em> </li> </ol> <p><strong>Assessments</strong></p> <p>The error message indicates that TFS can’t connect to the Analysis Service after upgraded. I then lunched the SQL Server Management Studio 2008 and successfully connected to the Analysis Service. So the Analysis Service should work fine. Since the issue began occurring after upgraded SQL Server. TFS might still use OM from SQL Server 2005 to connect to SQL Server 2008.</p> <p>To verify my guess, I restarted the IIS by running iisreset command and checked assembly binding information with <a href="http://msdn.microsoft.com/en-us/library/e74a18c4.aspx">fslogvw</a>. In the tool, I found an item for binding assembly Microsoft.AnalysisServices for w3wp.exe, which is the IIS worker process of TFS web site. Here are the log:</p> <p><em>LOG: Redirect found in application configuration file: 9.0.242.0 redirected to <span style="background-color: yellow">9.0.242.0</span>. </em> <br /><em>LOG: Post-policy reference: Microsoft.AnalysisServices, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91 <br />LOG: Found assembly by looking in the GAC. </em> <br /><em>LOG: Binding succeeds. Returns assembly from C:\Windows\assembly\GAC_MSIL\Microsoft.AnalysisServices\9.0.242.0__89845dcd8080cc91\Microsoft.AnalysisServices.dll. </em> <br /><em>LOG: Assembly is loaded in default load context.</em></p> <p>Obviously, the OM from old SQL Server 2005 was used. </p> <p><strong>Solution</strong></p> <p>In the installation folder of TFS, I navigated to Web Services\Warehouse, There’s a web.config there. After TFS 2008 SP1 is applied, it adds an assembly binding redirection for Microsoft.AnalysisServices. At the time when I installed TFS 2008 SP1, the SQL Server was not upgraded yet. So the Microsoft.AnalysisServices was directed to the version 9.0.242.0, which is from SQL Server 2005. </p> <p>On my another machine that SQL Server 2008 was already installed when applying the TFS 2008 SP1. This assembly was directed to 10.0.0.0. So the assembly redirection is supposed to be manually updated after upgrading the SQL Server. </p> <p>In the web.config, I redirected this assembly to 10.0.0.0 and restarted IIS. The problem was resolved. </p> <pre class="csharpcode"> <span class="kwrd"><</span><span class="html">dependentAssembly</span><span class="kwrd">></span><br /> <span class="kwrd"><</span><span class="html">assemblyIdentity</span> <span class="attr">name</span><span class="kwrd">="Microsoft.AnalysisServices"</span><br /> <span class="attr">publicKeyToken</span><span class="kwrd">="89845dcd8080cc91"</span><br /> <span class="attr">culture</span><span class="kwrd">="neutral"</span> <span class="kwrd">/></span><br /> <span class="kwrd"><</span><span class="html">bindingRedirect</span> <span class="attr">oldVersion</span><span class="kwrd">="9.0.242.0"</span> <span class="attr">newVersion</span><span class="kwrd">="10.0.0.0"</span><span class="kwrd">/></span><br /> <span class="kwrd"></</span><span class="html">dependentAssembly</span><span class="kwrd">></span></pre><br /><br /><p> </p><br /><br /><p>[EDIT] The SetupWarehouse command also utilizes the assembly Microsoft.AnalysisServices when rebuilding the TFS cube. So after upgrading to SQL Server 2008, you will also want to configure the SetupWarehouse.exe.config in the same manner. </p> Bill Wanghttp://www.blogger.com/profile/03863120660319844632noreply@blogger.com0tag:blogger.com,1999:blog-2886939197291429360.post-38579709142557571632009-03-30T05:41:00.001-07:002009-04-01T05:19:29.908-07:00Microsoft social platform updates<p>Last weekend, Microsoft social platform have been updated with significant changes. The new platform was written with ASP.NET MVC. The performance is much faster then the previous one. Here are the links to each social website. </p> <ol> <li><a href="http://social.expression.microsoft.com/search">http://social.expression.microsoft.com/search</a> </li> <li><a href="http://social.msdn.microsoft.com/search">http://social.msdn.microsoft.com/search</a> </li> <li><a href="http://social.technet.microsoft.com/search">http://social.technet.microsoft.com/search</a> </li> <li><a href="http://social.expression.microsoft.com/forums">http://social.expression.microsoft.com/forums</a> </li> <li><a href="http://social.microsoft.com/forums">http://social.microsoft.com/forums</a> </li> <li><a href="http://social.msdn.microsoft.com/forums">http://social.msdn.microsoft.com/forums</a> </li> <li><a href="http://social.technet.microsoft.com/forums">http://social.technet.microsoft.com/forums</a> </li> <li><a href="http://social.microsoft.com">http://social.microsoft.com</a> </li> <li><a href="http://social.expression.microsoft.com">http://social.expression.microsoft.com</a> </li> <li><a href="http://social.msdn.microsoft.com">http://social.msdn.microsoft.com</a> </li> <li><a href="http://social.technet.microsoft.com">http://social.technet.microsoft.com</a> </li> <li><a href="http://services.social.microsoft.com">http://services.social.microsoft.com</a> </li> </ol> Bill Wanghttp://www.blogger.com/profile/03863120660319844632noreply@blogger.com2tag:blogger.com,1999:blog-2886939197291429360.post-56280450350310840422009-03-25T21:18:00.001-07:002009-03-25T21:19:40.760-07:00Encounter TF220065 error during TFS installation<p>Yesterday, I helped an internal customer to troubleshoot a TFS installation issue. A search of TF220065 on google doesn’t reveal similar scenarios. So I’m blogging this problem and solution here. The following is the screenshot we got when installing TFS.</p> <p><a href="http://lh5.ggpht.com/_RC1R9QeaslU/ScsCFP9hW5I/AAAAAAAAAS8/x-anq6NCFJU/s1600-h/TF220065%5B4%5D.jpg"><img title="TF220065" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="338" alt="TF220065" src="http://lh5.ggpht.com/_RC1R9QeaslU/ScsCF0fCE7I/AAAAAAAAATA/ds5E2nWLzjw/TF220065_thumb%5B2%5D.jpg?imgmax=800" width="505" border="0" /></a> </p> <p>In my case, TFS is a dual server deployment. The Reporting Service was installed on the data tier. By default, TFS installation wizard “assumes” Reporting Service is installed on the application tier and is not configured. We configured the Reporting Service in the data tier and modified the following 3 properties as described in <a href="http://msdn.microsoft.com/en-us/library/bb909697.aspx">Msiproperty.ini File Properties</a>. Then the problem was resolved.</p> <ul> <li>VSTF_RS_SERVER=DB </li> <li>VSTF_RS_REPORTS_URI= <a href="http://DB/Reports">http://DB/Reports</a> </li> <li>VSTF_RS_REPORTSERVER_URI= <a href="http://DB/ReportServer">http://DB/ReportServer</a> </li> </ul> Bill Wanghttp://www.blogger.com/profile/03863120660319844632noreply@blogger.com4tag:blogger.com,1999:blog-2886939197291429360.post-79859058646848009762009-03-24T00:49:00.001-07:002009-04-23T03:45:12.029-07:00Troubleshooting team project creation error<p>To create a new team project in TFS is a complex process. Many community members reported issues when create a new team project. We already solved most of them in the forums. In this blog, I’m trying to organize some commonly seen errors. Hope it can help if you encounter issues when create a team project.</p> <p><strong>What does the Team Explorer do when creating a new team project</strong></p> <p>Based on configurations in the selected process template, when create a team project, Team Explorer will usually</p> <ol> <li>Create team project level groups and set the initial Access Control List (ACL). </li> <li>Import work item types and queries. </li> <li>Create initial work items. </li> <li>Create a team portal in the SharePoint and upload default documents and process guidance. </li> <li>Create a folder with the team project name in the Reporting Service and upload default reports. </li> </ol> <p><strong>How to find more information</strong></p> <p>Getting more information is useful to narrow down the cause. Here are 3 steps to find more information.</p> <ol> <li>Find the exception messages in the project creation log. At the end of the new team project wizard, there’s a link to the log file. Typically, the log locates in %TEMP% folder in the client computer. It is named in the form of VSTS_TeamProjectCreation_<Time>. The exception messages should point us a general direction. </li> <li>Run a  healthy check with Best Practice Analyzer (BPA) from <a href="http://msdn.microsoft.com/en-us/tfs2008/bb980963.aspx">TFS Power Tool</a>. in the October release of this power tool, we added rules simulating project process. You need to install BPA on the TFS machine. Fore more information about required permission in Reporting Service and SharePoint, please refer to <a href="http://msdn.microsoft.com/en-us/library/bb552341.aspx">How to: Set Team Foundation Server Administrator Permissions.</a> </li> <li>Check the Windows event log in TFS application tier. When the exceptions are thrown by TFS web services, they are usually get logged. </li> </ol> <p><strong>Some error messages you might see</strong></p> <ol> <li>TF30207: Initialization for plugin "Microsoft.ProjectCreationWizard.WorkItemTracking" failed <table id="hor-minimalist-b" border="0" width="466"><tbody></tbody><thead> <tr> <th valign="top" width="211" scope="col">Exception Message</th> <th valign="top" width="253" scope="col">Remedy</th> </tr> </thead><tbody> <tr> <td valign="top" width="211">TF201072: A user or group could not be found. Verify that the users and groups used in your work item type definition have been added to Team Foundation Server.</td> <td valign="top" width="253"><a href="http://support.microsoft.com/kb/958433">KB 958433</a></td> </tr> <tr> <td valign="top" width="211">TF30045: The instance information has not been configured or is not available for this Team Foundation Server.  Please contact your Team Foundation Server administrator.</td> <td valign="top" width="253">This is a general message. It often indicates the work item subsystem is not working. Please check the Windows Event Log on TFS application tier to find more information. </td> </tr> <tr> <td valign="top" width="211"> <p>TF26173: Team Foundation could not connect to the application tier. Check that you have a network connection and that the Team Foundation Server is available. If the problem persists, contact your Team Foundation Server administrator.</p> </td> <td valign="top" width="253">Replies in <a href="http://social.msdn.microsoft.com/Forums/en-US/tfssetup/thread/84083c9f-f0c9-410e-9167-04f09f02b160/">this thread</a>. </td> </tr> </tbody></table> </li> <li> <p><strong>TF30207</strong>: Initialization for plugin "Microsoft.ProjectCreationWizard.Reporting" failed</p> <table id="hor-minimalist-b" width="474"><tbody></tbody><thead> <tr> <th valign="top" width="281" scope="col">Exception Message</th> <th valign="top" width="194" scope="col">Remedy</th> </tr> </thead><tbody> <tr> <td valign="top" width="281">TF30224: Failed to retrieve projects from the report server. Please check that the SQL Server Reporting Services Web and Windows services are running and you have sufficient privileges for creating a project.</td> <td valign="top" width="194"> <p>There might be 3 causes:</p> <ol> <li>Team Explorer uses your current Windows account to connect to Reporting Service. Try using IE to open the web service url <a href="http://ReportingService/ReportServer">http://ReportingService/ReportServer</a> and report manager url <a href="http://ReportingService/Reports">http://ReportingService/Reports</a>. The expected behavior is that you can open those web sites without manually specify any credentials. </li> <li>If the data tier is using SQL Server 2008, then you need to install <a href="http://msdn.microsoft.com/en-us/vstudio/cc533448.aspx">Visual Studio 2008 SP1</a> on the client machine. The SP1 contains updates for Team Explorer. </li> <li>Insufficient permissions in Reporting Service. Please check <a href="http://msdn.microsoft.com/en-us/library/bb552341.aspx">How to: Set Team Foundation Server Administrator Permissions.</a> </li> </ol> </td> </tr> <tr> <td valign="top" width="281"> <p>TfsReportDS not defined to the SQL Server Reporting Services Server. Team Foundation needs to be repaired or reinstalled.</p> </td> <td valign="top" width="194"><a href="http://support.microsoft.com/kb/957202">KB 957202</a>.</td> </tr> </tbody></table> </li> <li> <p>TF30207: Initialization for plugin "Microsoft.ProjectCreationWizard.Portal" failed</p> <table id="hor-minimalist-b" width="471"><thead> <tr> <th valign="top" width="200" scope="col">Exception Message</th> <th valign="top" width="272" scope="col">Remedy</th> </tr> </thead><tbody> <tr> <td valign="top" width="200">TF30262: Error occurred while creating document library : Security retrying ... <br /> <br />Unable to connect to the remote server</td> <td valign="top" width="272">When this error occurs, the SharePont site collection for the team project portal should have already been created. But Team Explorer can’t connect to the portal to upload documents. <br /> <br />The portal is hosted in a SharePoint web application. So make sure the firewall doesn’t block the port of the web application. </td> </tr> <tr> <td valign="top" width="200">TF30162: Task "SharePointPortal" from Group "Portal" failed <br /> <br />The language id specified in the process template does not exist on the WSS server.</td> <td valign="top" width="272">Check Brian Harry’s blog <a href="http://blogs.msdn.com/bharry/archive/2007/08/14/tf30162-task-sharepointportal-from-group-portal-failed.aspx">TF30162: Task "SharePointPortal" from Group "Portal" failed</a>.</td> </tr> <tr> <td valign="top" width="200">Windows SharePoint Services version 2 templates are not supported in this version of the product.</td> <td valign="top" width="272">A process template references a SharePoint site template. After the process template is downloaded, you can find a <site> element in WSSTasks.xml which points a site template title. This issue happens when the site template is for WSS 2.0 and you TFS is using WSS 3.0. <br /> <br />You can use stsadm –o deletetemplate to delete the old template and upload the 3.0 version with the same tile by stsadm –o addtemplate. The 3.0 version of templates are located in Toos\Templates in TFS installation folder with a ‘30’ suffix.  </td> </tr> </tbody></table> </li> </ol> <p>If this blog doesn’t help in your scenario, you can contact <a href="http://social.msdn.microsoft.com/Forums/en/tfsadmin/threads/">Team Foundation Server – Administration forum</a> for further troubleshooting. </p> Bill Wanghttp://www.blogger.com/profile/03863120660319844632noreply@blogger.com2tag:blogger.com,1999:blog-2886939197291429360.post-89836260670323270862009-03-14T03:58:00.001-07:002009-03-25T21:21:20.361-07:00Encounter TF224004 when start build service<p align="left">Today, I configured my TFS to use HTTPS protocol. After configured one build agent to to use HTTPS, I got  TF224004 when trying to start the build service. </p> <p align="left"><em>Detailed Message: TF224004: The Visual Studio Team Foundation Build service failed to start because NT AUTHORITY\NETWORK SERVICE does not have the required access permissions for address </em><a href="https://161792m2:9191/Build/v2.0/AgentService.asmx"><em>https://161792m2:9191/Build/v2.0/AgentService.asmx</em></a><em>. Exception Message: HTTP could not register URL </em><a href="https://+:9191/Build/v2.0/AgentService.asmx/"><em>https://+:9191/Build/v2.0/AgentService.asmx/</em></a><em>. Your process does not have access rights to this namespace (see </em><a href="http://go.microsoft.com/fwlink/?LinkId=70353"><em>http://go.microsoft.com/fwlink/?LinkId=70353</em></a><em> for details). (type AddressAccessDeniedException)</em></p> <p align="left">“Network Service” is the service account of the build service. After reading Steven Cheng’s reply at <a title="http://www.devnewsgroups.net/group/microsoft.public.dotnet.framework/topic49734.aspx" href="http://www.devnewsgroups.net/group/microsoft.public.dotnet.framework/topic49734.aspx">http://www.devnewsgroups.net/group/microsoft.public.dotnet.framework/topic49734.aspx</a>, I figured out I was hitting the same issue. </p> <p align="left"><strong>Solution to this problem</strong></p> <ol> <li> <div align="left">On the build agent machine, open command window.</div> </li> <li> <div align="left">Run <strong>netsh http show urlacl</strong>. In the result, I noticed url <a href="https://161792m2:9191/Build/v2.0/AgentService.asmx">https://161792m2:9191/Build/v2.0/AgentService.asmx</a> was assigned a user other than “Network Service”.</div> <a href="http://lh5.ggpht.com/_RC1R9QeaslU/SbuN04v2KTI/AAAAAAAAASs/yih8Hzcx8bw/s1600-h/Previous%5B5%5D.jpg"><img title="Previous" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin-left: 0px; margin-right: 0px; border-right-width: 0px" height="153" alt="Previous" src="http://lh4.ggpht.com/_RC1R9QeaslU/SbuN1tC-__I/AAAAAAAAASw/tuxdxw2aBNU/Previous_thumb%5B3%5D.jpg?imgmax=800" width="644" border="0" /></a> </li> <li> <div align="left">Run <strong>netsh http delete urlacl url=</strong><a href="https://161792m2:9191/Build/v2.0/AgentService.asmx"><strong>https://161792m2:9191/Build/v2.0/AgentService.asmx</strong></a></div> </li> <li> <div align="left">Run <strong>netsh http add urlacl url=</strong><a href="https://+9191/Build/v2.0/AgentService.asmx"><strong>https://+9191/Build/v2.0/AgentService.asmx</strong></a><strong> user="NT AUTHORITY\NETWORK SERVICE"</strong></div> </li> <li> <div align="left">Run<strong> netsh http show urlacl</strong> again to verify the urlacl has been set correctly. </div> <a href="http://lh4.ggpht.com/_RC1R9QeaslU/SbuN2ql2JoI/AAAAAAAAAS0/9x3OLyhEfpY/s1600-h/After%5B3%5D.jpg"><img title="After" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="172" alt="After" src="http://lh6.ggpht.com/_RC1R9QeaslU/SbuN3QHNx9I/AAAAAAAAAS4/m3jM7pXw_zk/After_thumb%5B1%5D.jpg?imgmax=800" width="644" border="0" /></a> </li> </ol> <p>After adding the URLACL for “Network Service” account, the build service could be started up successfully. </p> Bill Wanghttp://www.blogger.com/profile/03863120660319844632noreply@blogger.com3tag:blogger.com,1999:blog-2886939197291429360.post-65431412103449250902008-12-28T23:18:00.000-08:002009-03-20T20:40:17.956-07:00Correct way of applying Visual Studio 2008 SP1Visual Studio family contains many products. The VS 2008 SP1 released a few months ago have fixes for all products in the family. An incorrect order of applying the service pack usually lead VS products into an inconsistent state. The most common issue I see is that a particular method/type in a VS assembly can't be found. <br /> <br />In Visual Studio 2008 SP1, we have fixes for <br /> <ol> <li>Visual Studio IDE. </li> <li>Team Explorer. </li> <li>Load Test Controller. </li> <li>Load Test Agent. </li> </ol> <p>See <a href="http://support.microsoft.com/kb/950264/">KB 950264</a> for detailed description. <br /> <br />When applying the SP1, only fixes for already installed products are applied. For example, you might have installed Visual Studio 2008, then applied the SP1, latter you installed the load test controller on the same machine, then fixes for the test controller would not be applied unless you install the SP1 again. <br /> <br />So, the correct order of applying the SP1 is to install the SP1 at the latest. If you applied the SP1 and later installed a new product in the above list, then you should apply the SP1 again. </p> Bill Wanghttp://www.blogger.com/profile/03863120660319844632noreply@blogger.com6tag:blogger.com,1999:blog-2886939197291429360.post-26707856438050407772008-12-26T22:54:00.000-08:002009-09-29T21:04:07.595-07:00TFS service account requires read permission in user domainsWhen TFS is deployed in an active directory domain environment, it makes use of windows accounts stored in domain. TFS uses the service account, usually TfsService, to read SID, email, display name and other account information from AD where TFS users belong to. As you can see here, the service account requires read permission in all TFS user domains. <br /> <br /><strong>Account synchronization condition</strong> <br />The synchronization happens <ol> <li>When TFS starts up </li> <li>When an account is added to a TFS group via Team Explorer </li> <li>When TFS task scheduler fires a synchronization every one hour </li> </ol> <p><strong>Multiple domain consideration</strong> <br />In organizations that TFS users may come from multiple domains, we can use a service account from a domain that is trusted by all other domains. When using Visual Studio to add users to TFS, we can log on the domain that is trusted by other domains so that we can list all domain accounts. <br /> <br /><strong>How to deal with TF200035? <br /></strong>Many customers reported <em>TF200035: One or more errors occurred when Team Foundation Server attempted to synchronize with the following Active Directory identity</em> error. It means TFS can't read account information from active directory for some TFS users. Please check if the account specified in this error message actually exists in the domain. We can also use "<a href="http://msdn.microsoft.com/en-us/library/ms400692.aspx">TfsSecurity</a> /server:TfsServer /imx domain\account" to simulate TFS synchronizing an account or group. If TFS can retrieve account information for an existing TFS user, it will display something like the following: <br /><img border="0" src="http://ttgl1w.bay.livefilestore.com/y1peGJmVOdZscJSXhNMzI7J49STD5hM_Jwvbo51vOZS04WJseYcEFYMwC8zzer66O90QlflWYTSuZ4/ReadAccount.jpg" /> <br /> <br /><strong>More resources to read</strong> <br /><a href="http://msdn.microsoft.com/en-us/library/ms253081.aspx">Trusts and Forests Considerations for Team Foundation Server</a>. </p> Bill Wanghttp://www.blogger.com/profile/03863120660319844632noreply@blogger.com6tag:blogger.com,1999:blog-2886939197291429360.post-72640496787616649342008-12-19T21:57:00.000-08:002009-03-20T20:43:29.094-07:00Useful commands for solving Visual Studio problemsVisual Studio(VS) is a very complex software. Sometimes you may suffer issues while using it. Here are some commands that might help to bring VS back to normal. If you have multiple version of VS installed, make sure the commands are run in the installation folder of the correct version of Visual Studio. <br /> <ol> <li><strong>devenv /ResetUserData</strong> <br />This command is used to reset user data. Settings in the Tools->Options within Visual Studio will be reset. You might need to export your settings before run this command. <br />In MSDN forums, I saw many customers reported that VS is in weird states such as a window is missing, tool buttons in a window is not correct etc. This command solved most of these issues. </li> <li><strong>devenv /ResetSkipPkgs <br /></strong>When a package loading error occurs, we may suppress VS to load it in the future. This approach hides the problem. ResetSkipPkgs switch will make VS to load the skipped packages while launching VS. After we get the error message for package loading error, we can do more troubleshooting. </li> <li><strong>devenv /setup <br /></strong>This command is used to build menus, commands and registry settings for all VS packages. Many VS add-ons contain packages. When we get package errors for an add-on, the first thing to try is repairing the add-on. If the repair doesn't work, just run devenv /setup. </li> <li><strong>devenv /SafeMode</strong> <br />This command will start VS in safe mode. In safe mode, VS will not load any third party packages.</li> </ol> Bill Wanghttp://www.blogger.com/profile/03863120660319844632noreply@blogger.com72tag:blogger.com,1999:blog-2886939197291429360.post-45041073771018315362008-12-18T02:06:00.000-08:002009-06-21T00:23:30.554-07:00About Me<p>Hi, I'm Bill Wang and I create this blog to share my experiences. I was born in southern China in 1986. Since graduated in 2008, I have been working as a support engineer in Microsoft. I work on <a href="http://social.msdn.microsoft.com/Forums/en-US/category/vsts">Visual Studio Team System Forums</a> and newsgroups to help custom to use TFS smoothly. If you often surf the VSTS Forums, you probably already knew me.</p> <p><img style="display: inline; margin-left: 0px; margin-right: 0px" src="http://3.bp.blogspot.com/_RC1R9QeaslU/SUohXxOnQEI/AAAAAAAAAOw/Osr1duKx2IE/s400/IMG_2803.JPG" /></p> Bill Wanghttp://www.blogger.com/profile/03863120660319844632noreply@blogger.com21tag:blogger.com,1999:blog-2886939197291429360.post-32765849399496300262008-12-18T00:45:00.000-08:002009-04-23T23:53:30.244-07:00Contact <form method="post" action="http://www.emailmeform.com/fid.php?formid=292037" enctype="multipart/form-data" accept-charset="UTF-8"> <table cellpadding="2" cellspacing="0" border="0" bgcolor="#FFFFFF"> <tr> <td> <font face="Verdana" size="2" color="#000000"></font> <div style="" id="mainmsg"> </div> </td> </tr> </table> <br> <table cellpadding="2" cellspacing="0" border="0" bgcolor="#FFFFFF"> <tr valign="top"> <td nowrap><font face="Verdana" size="2" color="#000000">Your Name</font></td> <td> <input type="text" name="FieldData0" value="" maxlength="100" size="30"> </td> </tr> <tr valign="top"> <td nowrap><font face="Verdana" size="2" color="#000000">Your Email Address</font></td> <td> <input type="text" name="FieldData1" value="" maxlength="100" size="30"> </td> </tr> <tr valign="top"> <td nowrap><font face="Verdana" size="2" color="#000000">Subject</font></td> <td> <input type="text" name="FieldData2" value="" maxlength="100" size="30"> </td> </tr> <tr valign="top"> <td nowrap><font face="Verdana" size="2" color="#000000">Message</font></td> <td> <textarea name="FieldData3" cols="60" rows="10"></textarea><br> <div style="position: absolute; left: 1800px; top: 20px;"><a href="http://www.emailmeform.com">php form</a></div></td> </tr> <tr> <td colspan="2"> <table cellpadding=5 cellspacing=0 bgcolor="#E4F8E4" width="100%"> <tr bgcolor="#AAD6AA"> <td colspan="2"><font color="#FFFFFF" face="Verdana" size="2"><b>Image Verification</b></font></td> </tr> <tr> <td style="padding: 2px;" width="10"><img src="http://www.emailmeform.com/turing.php" id="captcha"></td> <td valign="top"><font color="#000000">Please enter the text from the image</font> <br><input type="text" name="Turing" value="" maxlength="100" size="10"> [ <a href="#" onclick=" document.getElementById('captcha').src = document.getElementById('captcha').src + '?' + (new Date()).getMilliseconds()">Refresh Image</a> ] [ <a href="http://www.emailmeform.com/?v=turing&pt=popup" onClick="window.open('http://www.emailmeform.com/?v=turing&pt=popup','_blank','width=400, height=300, left=' + (screen.width-450) + ', top=100');return false;">What's This?</a> ] </td> </tr> </table> </td> </tr> <tr> <td> </td> <td align="left"> <input type="text" name="hida2" value="" maxlength="100" size="3" style="display : none;"> <input type="submit" class="btn" value="Send email" name="Submit"> <input type="reset" class="btn" value=" Clear " name="Clear"></td> </tr> <tr> <td colspan=2 align="center"> <br> </td> </tr> </table> </form> Bill Wanghttp://www.blogger.com/profile/03863120660319844632noreply@blogger.com1