Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.csproj.user issues when checked into TFS

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.

like image 781
TrueWill Avatar asked Mar 19 '12 15:03

TrueWill


People also ask

How do I fix Csproj?

First you have to navigate to the project's node in Solution Explorer. Then you have to right-click > Unload the project. Then you have to right-click > Edit the csproj file. Then you have to find the offending line in the csproj file and modify or delete it.

What is Csproj user file?

csproj" is a Visual Studio . NET C# Project file extension. This file will have information about the files included in that project, assemblies used in that project, project GUID and project version etc. This file is related to your project. It will be automatically generated when we create .

Should Csproj be in git?

Short answer: You definitely need . csproj files in your git history.

What is Csproj extension?

What is a CSProj file? Files with CSPROJ extension represent a C# project file that contains the list of files included in a project along with the references to system assemblies.


1 Answers

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>
like image 89
makhdumi Avatar answered Sep 18 '22 09:09

makhdumi