Question

We made the mistake of allowing .csproj.user files to be checked in to TFS so we could set "Start external program" defaults. This worked poorly, especially when branching.

Now we're trying to undo this.

If I delete the .csproj.user file for a project and then try to set new project debug properties, I get:

TF14050: Cannot change item $/xxx.csproj.user because it already has a pending change that is not compatible.

If I check in the delete and make changes, TFS then tries to re-add my .csproj.user file.

How can we fix this for existing projects in source control?

Update:

I think destroying them is the best option; we ended up just deleting them with the TFS Power Tools, though. The trick was to first Remove the Source Control File Type we had for *.user, even though it was already disabled. Now TFS appears to completely ignore these files.

Was it helpful?

Solution

I suggest that you use the Destroy command. Be careful since it deletes permanently. MSDN documentation: http://msdn.microsoft.com/en-us/library/bb386005.aspx

Start a Visual Studio 2010 Command, and use tf.exe ...

OTHER TIPS

I also wanted to check in .user files to do what the asker wanted, to provide defaults for the debug/run options. It turns out that the .user file is just another MSBuild Project XML file, and you can just "merge" the property group in there into your project. No need for .user files.

  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
    <StartAction>Program</StartAction>
    <StartProgram>$(VS100COMNTOOLS)..\IDE\devenv.exe</StartProgram>
    <StartArguments>/rootsuffix Exp</StartArguments>
  </PropertyGroup>

Make sure no one has the file checked-out then delete the file - checking in as a delete and not an edit.

I use Team Foundation Power Tools and do it from the Windows Shell Context menu

After you delete a file in TFS, it isn't gone yet. You need to Check-in your deletion. Only then will the file be gone.

It's best practice to then also clean your workspace to make sure the user files don't linger as read-only files.

I use TFS Git and I was able to delete the unwanted file on the server via the TFS project site. Then I synced the local project with the server.

When you open the project to sync VS might complain that you can't sync until you commit changes to the unwanted file. This is exactly what I didn't want to do, I wanted the file to go away.

However, in the change screen I right clicked the file and said 'undo changes' and that made it go away.

After, undoing changes I was able to sync and the server removed the unwanted file from my local repository.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top