Showing posts with label Team Foundation Server. Show all posts
Showing posts with label Team Foundation Server. Show all posts

Tuesday, 4 June 2013

Adding EF POCO Classes to TFS Source Control

I have various projects which included Entity Framework POCO (Plain Old CLR Object) Classes. By default, these are not automatically included in TFS Source Control.

To add these classes in VS2012;

  1. Open the Team Explorer Window using View>Team Explorer
  2. You will see a list of shortcuts... My Work, Pending Changes and so on;
  3. Under "Pending Changes" is a link to "Source Control Explorer"
  4. Click this link, to open the Source Control Explorer Window
  5. Navigate through your solution to the Project containing your edmx file
  6. Above the "Source Location" will be a toolbar
  7. The fourth icon from the left is "Add Items To Folder"
  8. Clicking this icon will bring up the "Add to Source Control" Dialog, showing all the files in this project which aren't currently under Source Control.
  9. Select all the files you wish to now include under Source Control
  10. Press Next, then Finish

Now Check In your Solution again, and your POCO's should now be included.

Visual Studio – Solutions not configured for Integrated Source Control

I recently ran into an issue where, when I opened up one of my Solutions which were under TFS Source Control, I was presented with a message box which showed;

The solution you have opened is under source control but not currently configured for integrated source control in Visual Studio. Would you like to bind this solution to source control now?

Turns out that this is Visual Studio’s way of telling me that parts or all of my solution isn’t bound correctly to the source control provider.

To rectify this issue I needed to;

  1. Open the Project directly using Visual Studio, rather than with the Source Control Explorer
  2. Goto File ->Source Control –>Advanced –> Change Source Control

This will open up the “Change Source Control” dialog, which shows which items in your solution are bound and which aren’t.

From here you simply need to select which Items need to rebound and hit the “Bind” button.

Visual Studio will then checkout the unbound items, and you then need to check them back in, and your done.

Wednesday, 2 January 2013

Adding EF5 POCO’s to TFS Source Control

While attempting to build my TFS based solution, the build failed reporting that it couldn’t find my EF5 POCO Classes.

After some digging around it seems that these files aren’t automatically included under TFS Source Control.

In order to enable this (For VS 21012), we must perform the following actions;

1. Open the Team Explorer Window using View>Team Explorer
2. You will see a list of shortcuts... My Work, Pending Changes and so on;
3. Under "Pending Changes" is a link to "Source Control Explorer"
4. Click this link, to open the Source Control Explorer Window
5. Navigate through your solution to the Project containing your edmx file
6. Above the "Source Location" will be a toolbar
7. The fourth icon from the left is "Add Items To Folder"
8. Clicking this icon will bring up the "Add to Source Control" Dialog, showing all the files in this project which aren't currently under Source Control.
9. Select all the files you wish to now include under Source Control
10. Press Next, then Finish

Now Check In your Solution again, and your POCO's should now be included.

As a word of warning, I have read that it’s possible to get Read / Write issues when performing this action. Allegedly, checking out the problem items will overcome this issue.