Deleting Projects from TFS

8 06 2009

MSDN article about TFSDeleteProject. Has usage and troubleshooting.

Just wanted to create a quick reference for myself for future use.

http://msdn.microsoft.com/en-us/library/dd206696.aspx

Use:
TFSDeleteproject [/q] [/force] [/server:servername] team project name

Argument Description
Team project name The name of the project. Use quotation marks if there are spaces in the name.
servername The server name. Use quotation marks if there are spaces in the name.
 
Option Description
/q Use the quiet mode. Do not prompt the user for confirmation.
/server:servername The name of the application-tier Team Foundation Server where the team project is located. This is required in multi-server environments.
/force The program should continue even if some parts cannot be deleted.

*NOTE: TFSDeleteProject.exe is located in {Drive}\Program Files\Microsoft Visual Studio 9.0\Common7\IDE





TFS Power Tools Collaboration Error

5 06 2009

A few days after installing the TFS Power Tools, I started getting error messages whenever I opened up the Team Explorer pane in Visual Studio. The exact error was:

Creating an instance of the COM component with CLSID {B69003B3-C55E-4B48-836C-BC5946FC3B28} from the IClassFactory failed due to the following error: 8007000e.

The problem was related to the collaboration piece of the tool. My installation had Widows Live Messenger as the selected provider. I don’t know if this is the default selection or if somehow the installation detected what was running. Either way, the fix to stopping the error messages was to disable the collaboration piece.

  1. Right click on the Team Members node of the project.
  2. Select Personal Settings… from the context menu.
  3. In the Collaboration grouping, click on the Change button.
  4. In the window to choose a collaboration provider, select <None>
  5. Click OK twice.

As a side note, other than the message box showing the error, I didn’t really encounter any problems with the operation of TFS. The other option available, aside from Messenger, was to use Communicator as the collaboration medium.





TF30177: Team Project Creation Failed

3 06 2009

I encountered the error below when trying to create a new project under TFS. TFS was a brand new install and I was making sure the installation didn’t have any problems.

TF30177: Team Project Creation Failed

Error
TF30004: The New Team Project Wizard encountered an unexpected error while initializing the Microsoft.ProjectCreationWizard.Reporting plug-in.

Explanation
TF30171: The Microsoft.ProjectCreationWizard.Reporting plug-in used to create the new team project could not be initialized and returned the following error: 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..

User Action
Contact your Team Foundation Server administrator.

After experimenting with permissions for the TFS service and TFS reporting accounts for the local machine, reporting services and WSS, to no avail, I finally came accross Jason Barile’s blog about installing VS 2008 SP1 AFTER installing Team Explorer.





Visual Studio (2005, 2008) Keyboard Shortucts

27 05 2009

Thought I’d put up my personal reference for Visual Studio’s keyboard shortcuts and update on a periodic basis. Not sure how to organize this so expect this to change/evolve. For now it is somewhat based on the ones I use most often, since those will be the easiest to remember :P .

Insert empty line above cursor
Ctrl + Enter

Insert empty line below cursor
Ctrl + Shift + Enter

Comment/Uncomment
Ctrl + K, C / Ctrl + K, U
Highlight the lines you want to comment/uncomment

Delete an entire line
Ctrl + L

Toggle Set/Unset Bookmarks
Ctrl + K, K

Go to Next Bookmark
Ctrl + K, N

Format the entire document
Ctrl + K, D

Format the entrie selection
Ctrl + K, F
Highlight/select entire text to be formatted.

Update reference (add a using statment for C#)
Ctrl + .
Have the cursor on the text that is missing the reference.

Quick watch (Debugging)
Ctrl + Alt + Q
Highlight the code you want to watch and hit the sequence to add it to the quick watch dialog.

Collapse document block
Ctrl + M, O
I can’t seem to recall how to uncollapse the entire document.

Toggle collapse/uncollapse current block
Ctrl + M, M





C# 3.0 – Part II :: Object & Collection Initializers

7 11 2008

In part I, the feature discussed was auto-implemented properties. Here we’ll make use of the classes defined in part I to demonstrate object initializers.

Notice that no constructor was declared in the classes defined. The compiler creates a default constructor (empty constructor), but this isn’t new in 3.0. What is new, is a way to set the properties of the object as it is initialized.

// declare and initialize an instance of the Address class
Address homeAddress = new Address()
{
// set the properties using C# 3.0 object initializer feature
Street = "123 Some Street",
City = "Newport Beach",
State = "CA",
PostalCode = "92626",
AddressType = AddressType.Home
};

We can then use the homeAddress instance to instantiate a Person object, also defined in part I.

Person person = new Person()
{
ID = 1,
FirstName = "John",
LastName = "Doe",
Addresses = new List<Address>(){ homeAddress }
};

Notice that we’ve initialized the collection of addresses of the person instance, as the object itself is initialized. Collection Initializers is also a new feature of C# 3.0. Instead of calling the Add method of a collection, we can simply list the objects, similar to that of arrays.

We can even combine the initialization of objects and collections into one big block of code.

Person person = new Person()
{
ID = 1,
FirstName = "John",
LastName = "Doe",
Addresses = new List<Address>()
{
new Address()
{
Street = "123 Some Street",
City = "Newport Beach",
State = "CA",
PostalCode = "92626",
AddressType = AddressType.Home
}}};

Probably the most interesting to me are the collection initializers. I’ve often have had to create lookup dictionaries for one reason or another. Typically the process is declare and instantiate the dictionary and then populate with lookup values.

Dictionary<int, string> numberLookup = new Dictionary()<int, string>();
numberLookup.Add(1, "one");
numberLookup.Add(2, "two");

Instead, we can instantiate like so:

Dictionary<int, string> numberLookup = new Dictionary()<int, string>()
{
{ 1, "one" },
{ 2, "two" }};