How to override the connection string and target database of a database project

Problem: I need to override the connection string and target database of a database project built with Team Build. Solution: Pass the TargetConnectionString and TargetDatabase parameters to team build. Explanation: Although Team Build in 2010 is Windows Workflow based at the end of the day MSBuild is still being called to perform the actual build. Project files in Visual Studio are just MSBuild project files.  Not only does this make building Visual Studio projects and solution very easy but it also allows us to pass parameters to our builds.  Any properties set in a project file can be overwritten by passing in parameters to MSBuild.  The parameters we need to override are TargetConnectionString and TargetDatabase.  On the Process Tab of the Team Build 2010 Build Definition wizard you can use the MSBuild Arguments parameter to pass in parameters to MSBuild.  For example I can pass in the following to override the values in the project file, /p:TargetConnectionString="Data Source=.;Integrated Security=True;Pooling=False" /p:TargetDatabase=MyDatabase This allows me to keep the project file in version control set to the values used for development and override them for build when I deploy to different environments. 

Can't save values in custom controls on TSWA 2010

Problem: I just upgraded my TFS 2008 to 2010 and my custom TSWA controls are no longer saving values. Solution: Make sure the first thing you do in the InitializeControl() method from the IWebWorkItemControl inteface is call the code that populates the base.Controls collection.  For example to get the MultiValue control to work you must add a call to EnsureInnerControls() as the first line in InitializeControl() otherwise the values will not save.

Where in the world is WorkItemChangedEvent defined?

Problem: I am not asked to write TFS Event Handler web services very often and I can never remember where WorkItemChangedEvent is defined.  I spend more time searching for that missing reference than I do writing the code. Solution: For TFS 2010 WorkItemChangedEvent is in C:\Program Files\Microsoft Team Foundation Server 2010\Tools\Plugins\Microsoft.TeamFoundation.WorkItemTracking.Server.Dataaccesslayer.dll.