I can't get rid of an old Project Template

Problem I was trying to learn how to create a custom Project Template and now I can't get rid of it! Solution Make sure all the .zip files for your Project Template have been deleted and run devenv /setup Explanation Running devenv /setup will force Visual Studio to reset all the Project Templates and also get rid of old ones.

How to change the name of a CodedUI method without Feature Pack 2.

  Problem: I want to change the name of a method generated by the Coded UI Builder. Solution: Modify the UI map and regenerate code. Explanation: I would suggest downloading Feature Pack 2. However, if you are not a MSDN subscriber you may not have access to FP2. When you record using the Coded UI Test Builder or use an Existing Action Recording you may end up with method names you wish you could change.  We have all been taught to never modify a .Designer file because those are generated an may change at any time.  So the key is to update the value in the source of the code generation. That is the .uitest file.  A .uitest file is an XML representation of the actions taken during the recording.  To change a method name you simply locate the TestStepMarkerAction element with the MarkerInformation attribute with the value of the method you wish to change.  Update the file with the desired method name then save and close the file.  Now we must cause the .Designer file to be regenerated to use the new method names.  From the Solution Explorer right click the .uitest file and select Edit with Coded UI Test Builder.  Once the Coded UI Test Builder opens simply click the Generate Code button and close the builder.  Now the .Designer file will contain the new method names.      

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. 

Demo Source Code

For those that wanted the demo code I presented today in the Web Cast it is here. It includes the code to databind a Coded UI Test. Thanks for joining me and I hope you enjoyed it. Demo.zip (408.41 kb)