How to start over with Team Foundation Server

I have a Visual Studio 2012 solution that was connected to Team Foundation Server.  Unfortunately, I deleted some files in my project, and added them back.  (I didn't realize that once a file is deleted in VS, a file with the same name and location can never be added back to TFS.)  After trying to rollback and then redo changes several times, it got to where there were many conflicts that couldn't be resolved.  Plus the mere process of checking things in tended to change my project so it wouldn't run. (Fortunately, I made a few different backups of the project on my local drive, as I realized that at this point TFS had gotten very messed up.)

So what I'm trying to do now is to start over...to basically create a whole new repository on TFS for the project and start from scratch.  But it's not cooperating.  Here's what I tried:  I went to File | Source Control | Advanced | Changed Source Control, and then selected "Unbind" for my solution and its projects.  Then I tried to re-add the project to Source Control, creating a new folder.  It complained that the project is already in source control.  However, I went out of VS and came back, and went back to "Change Source Control," and selected "Bind," and the Server Bindings gave a path that matched my new folder name that I had just created.  So I thought that this was okay, and I tried to check everything in.  But it only wanted to check in the few files that were different from the old repository (the one that I'm trying to get away from).  And sure enough, even if I tried to check those few files in, it says there are all sorts of conflicts.  So even though the "Server Binding" for the Solution and Projects points to a newly created folder, it still remembers where it was pointing before.

So I repeated the above steps, except that this time, I deleted the .suo file and also the source control meta data files for my solution and project.  I also looked in the solution and project files themselves to see if there were any references to Team Foundation Server, but I did not find any.  However, when I tried to bind to a new folder name in the TFS server, it still acted as if it was connected to the original messed-up repository.

Is there a way to make it forget about the old repository and just start from scratch?
NewbisAsked:
Who is Participating?
 
Bob LearnedCommented:
TFS stuff is stored in different places:

1) Solution:

      GlobalSection(TeamFoundationVersionControl) = preSolution
            SccNumberOfProjects = 1
            SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
            SccTeamFoundationServer = http://tfs:8080/tfs/teamproject
            SccLocalPath0 = .
            SccProjectUniqueName1 = UnitTests\\UnitTests.csproj
            SccProjectName1 = UnitTests
            SccLocalPath1 = UnitTests
      EndGlobalSection

2) Project:

<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <ProjectGuid>{55D38B7C-B732-427B-A7B4-7CAACDC460EB}</ProjectGuid>
    <SchemaVersion>2</SchemaVersion>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <AssemblyName>RetargetingService</AssemblyName>
    <OutputType>WinExe</OutputType>
    <RootNamespace>RetargetingService</RootNamespace>
    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    <TargetFrameworkProfile />
   <SccProjectName>SAK</SccProjectName>
    <SccLocalPath>SAK</SccLocalPath>
    <SccAuxPath>SAK</SccAuxPath>
    <SccProvider>SAK</SccProvider>

  </PropertyGroup>

3) .vspscc file where the project is located:

""
{
"FILE_VERSION" = "9237"
"ENLISTMENT_CHOICE" = "NEVER"
"PROJECT_FILE_RELATIVE_PATH" = ""
"NUMBER_OF_EXCLUDED_FILES" = "0"
"ORIGINAL_PROJECT_FILE_PATH" = ""
"NUMBER_OF_NESTED_PROJECTS" = "0"
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
}

4) .vssscc file where the solution is located:

""
{
"FILE_VERSION" = "9237"
"ENLISTMENT_CHOICE" = "NEVER"
"PROJECT_FILE_RELATIVE_PATH" = ""
"NUMBER_OF_EXCLUDED_FILES" = "0"
"ORIGINAL_PROJECT_FILE_PATH" = ""
"NUMBER_OF_NESTED_PROJECTS" = "0"
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROJECT"
}
0
 
Bob LearnedCommented:
I deleted the .suo file and also the source control meta data files for my solution and project.
I am not sure what that means.

Did you delete the .vspscc files for the project?

Did the project file have these lines?

   <SccProjectName>SAK</SccProjectName>
    <SccLocalPath>SAK</SccLocalPath>
    <SccAuxPath>SAK</SccAuxPath>
    <SccProvider>SAK</SccProvider>

Did you delete the project folder in TFS, and commit changes?
0
 
NewbisAuthor Commented:
I thought I had deleted the XML stuff, but I must not have, because when  tried it again after posting this, I did find that there was TF stuff in the file after all, and it deleted it, and then it worked.

Odd thing was that once all that was deleted, I could no longer pick the name of the new folder.  Fortunately, it remembered the name of the new folder that I was attempting to create before, so it used that.
0
 
Bob LearnedCommented:
There are tools for cleanly removing the bindings (although I can't personally vouch for them):

VS Unbind Source Control
http://vsunbindsourcecc.codeplex.com/
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.