project-system icon indicating copy to clipboard operation
project-system copied to clipboard

Please do not put source control concerns in the .csproj (SccProjectName, etc)

Open jnm2 opened this issue 7 years ago • 15 comments

If you create a new csproj, source control icons in Solution Explorer and change detection do not function properly, and when you open the project Visual Studio prompts you to select source control configuration. To make the problem go away, it inserts this in your csproj:

  <PropertyGroup Label="Globals">
    <SccProjectName>%24/TFS/Path</SccProjectName>
    <SccProvider>{SOME_GUID}</SccProvider>
    <SccAuxPath>http://servername:8080/tfs/ProjectCollectionName</SccAuxPath>
    <SccLocalPath>.</SccLocalPath>
  </PropertyGroup>

First, this is what the legacy csprojs had, and this also works:

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

But as should hopefully be clear from the second snippet, this is not providing any information of value which can't already be determined by looking at the workspace mapping. If this was a project under Git source control, that's exactly what Visual Studio would do. It should do the same for TFS and keep the csproj clean of such concerns.

Since you're improving the .csproj story with this project system, please be consistent and consistently separate concerns cleanly. A csproj should be able to go back and forth between Git and TFS source control without changing. The contents of the entire solution should be independent of its location.

jnm2 avatar Mar 20 '17 23:03 jnm2

I am fully encourage.

fe-c avatar Apr 02 '17 17:04 fe-c

related: https://github.com/dotnet/project-system/issues/2758

abpiskunov avatar Sep 26 '17 16:09 abpiskunov

@jjmew @davkean Is there any progress on this issue?

skrysmanski avatar May 20 '20 11:05 skrysmanski

@skrysmanski Thanks for reaching out. As of now we haven't scheduled time to work on this. It is unlikely that we will get to this in the near future.

jjmew avatar May 21 '20 18:05 jjmew

This should also include getting rid of the vspscc and vssscc files.

StingyJack avatar Aug 19 '20 19:08 StingyJack

This is so painful when using branches in TFS VC and causes very unnecessary churn and noise in change sets, and code history. Please fix this.

What is the consequence of checking in a branched project that still references the source branch path for this <SccProjectName /> element?

Jaans avatar Oct 24 '20 13:10 Jaans

I think VS complains about the source control bindings when you load the solution, but I have "SAK" in the proj files, which makes vs refer to the solution for the binding info.

StingyJack avatar Oct 24 '20 13:10 StingyJack

This should also include getting rid of the vspscc and vssscc files.

https://github.com/dotnet/project-system/issues/1801

jnm2 avatar Oct 24 '20 14:10 jnm2

Additionally, Visual Studio does not appear to recognise a project file that imports "SAK" versions of these values. Hence they MUST actually be in the project file.

RachelDavids avatar Jan 12 '21 10:01 RachelDavids

2021... any updates?

sk0va avatar Jul 16 '21 13:07 sk0va

2022 here wondering if there are any updates

nthornton2010 avatar May 11 '22 18:05 nthornton2010

2023 let's hope!

TrabacchinLuigi avatar Jan 03 '23 15:01 TrabacchinLuigi

2024 checking in 😄

rkaltenbach-wis avatar Jan 22 '24 09:01 rkaltenbach-wis

2024 checking in 😄

2036 checking in (yes, we finally have time travel). Still not fixed. Microsoft now owned by Elon Musk. Elon promises to get it fixed by 2019 which, by happenstance, will cascade into a wonderous chain of events that prevents COVID-19 from being a thing. We'll see. Or maybe we won't?

Mythran101 avatar Mar 28 '24 23:03 Mythran101

Mixing source control metadata in the csproj file is a terrible idea. Could the following be the default when not specified?

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

Wdestroier avatar Jul 31 '24 14:07 Wdestroier