Answered Visual Studio 2010 bug with linked files and tfs

  • 2 martie 2012 08:24
     
     

    Hi,

    first I would like to say that this question will probably sound like a TFS problem, but I've already verified that it isn't a problem with the tfs server.

    In VS2008 when I add a linked file to a project and for example I linked to the wrong file. When I delete the link to that file this only triggered a pending change for my vbproj file, which is correct because I only want to remove the link from my project and not delete the actual file.

    When I do the same in VS2010 this triggers a pending change for my vbproj file but also a delete pending change for the linked file and this is wrong because I only want to remove the link to the file and not the file.

    I've tested this with VS2008 & VS2010 on a TFS 2010, with 2008 it works as expected with 2010 it doesn't

    Does anyone know of a fix? Any help is much appreciated

    You can view some print screens here:

    Add As Link

    Linked File

    Pending changes after delete VS2008

    Pending changes after delete VS2010

    • Mutat de Bob_BaoMVP, Moderator 6 martie 2012 05:52 (From:Visual Studio Source Control and SourceSafe)
    •  

Toate mesajele

  • 5 martie 2012 06:42
    Moderator
     
     

    I did not reproduce it. My VS 2010 has updated to SP1 and connect to my TFS server, just add a file as link, then check-in this change. Remove the linked file in my project, and view the pending changes, just the project file should be checked in:

    So could you please share some VS information and TFS version information? And do you map the location of the original linked file, or put the original linked file in source control.

    Sincerely,


    Bob Bao [MSFT]
    MSDN Community Support | Feedback to us

  • 5 martie 2012 07:43
     
     

    Hi,

    thanks for your reply

    my Visual Studio version is: 10.0.40219.1 SP1Rel

    the TFS Version number is: 10.0.40219.371 (SP1 KB2643415)

    The file that I'm linking to is also under source control in the same team project

    Sincerely,

    Peter

  • 6 martie 2012 06:16
    Moderator
     
     
    Thanks for your reply, we will do more testing on this scenario, and continue to consult it internally.

    Bob Bao [MSFT]
    MSDN Community Support | Feedback to us

  • 6 martie 2012 07:56
     
     

    I see you're using VB.NET, can you reproduce it with a C# project as well?

    And do you have any add-ins installed, such as VSCommands or any other product which enhances the Solution Explorer?


    My blog: blog.jessehouwing.nl

  • 6 martie 2012 08:36
     
     

    I get the same result with a C# project

    Add linked file

    Pending changes after delete

    Installed Extensions

    Sincerely

  • 6 martie 2012 08:42
     
     

    If I uninstall the "productivity power tools" and "visualization and modeling feature pack" I keep getting the same result. The Theme editor extensions was installed after I noticed the problem so this can't be causing it in my opinion. 

    Sincerely,

    Peter

  • 6 martie 2012 22:38
    Proprietar
     
     

    Thanks for the screen shots. However, can you give me exact steps you follow to see this behavior? Also, what is the exact problem that this is causing you?  Do you get an error or does something else detrimental occur?


    Trevor Hancock (Microsoft)
    Please remember to "Mark As Answer" the replies that help.

  • 7 martie 2012 07:45
     
     

    Hi,

    the steps are:

    I've got two solutions in one team project. Solution A and solution B. In solution A, I want to link to one (or multiple) files from solution B. So in solution A I right click the solution and choose "Add" => "Existing Item". I then browse to the file I want and select "Add As Link", the file is than added as a link in solution A. The problem occurs when I for example no longer need the link and want to remove it from solution A. I select the link and press delete, this triggers a pending change for my vbproj file which is correct, because this is where the link is stored. But there is also a pending change triggered for a delete of the linked file. This is a problem when I check in my pending changes, the file I linked to is actually deleted, but I still need it in it's original location, Solution B. So for the moment if I want to remove a link, I have to manually edit my vbproj file

    In VS2008 and the same TFS server this works as expected, I get only a pending change for my vbproj file.

    Here are two videos of my steps one in VS2010 and one in VS2008

    I hope the problem is clear now,

    Peter

  • 12 martie 2012 08:12
     
     

    Have you been able to reproduce the problem?

    Peter

  • 13 martie 2012 21:46
    Proprietar
     
     

    Sorry  for the delay.  I was testing this.


    I did a test in TFS 2010.  I made two projects. Console Application1 (solution A) and WindowsApplication3 (Solution B).  I added two files as links from WindowsApplication3 to the Console Application1. I checked in the changes.  I then deleted the two links in Console Application1.  I look at the pending changes in WindowsApplication3 and the two files have a Delete as a pending action.


    I don't see a way to prevent this.  I  can undo the pending change in WindowsApplication3 to remove the Delete action.  Is this acceptable?

    You might want to enter this on the Visual Studio Connect site:
    https://connect.microsoft.com/VisualStudio/Feedback

     


    Trevor Hancock (Microsoft)
    Please remember to "Mark As Answer" the replies that help.

  • 14 martie 2012 07:22
     
     Răspuns

    Hi thanks for your help. I'll enter the problem in the feedback site. Maybe there's a reason why they changed the way this works from VS2008. I already had the same workaround:

    1) Undo pending deletes
    2) Checkin vbproj file
    3) Unload and reload the project

    I don't find this acceptable (especially cause it worked in 2008).

    I mean the workaround works but it's prone to someone forgetting it and deleting the files, but I guess I'll have to accept it :-) and I know you can't do anything about so I'm not blaming you or anything.

    Thanks again for the help and verifying the "bug"

    Peter

  • 14 martie 2012 07:42
     
     

    Here is the link to my Visual Studio Connect feedback item, so if anyone else is experiencing this problem please vote it:

    https://connect.microsoft.com/VisualStudio/feedback/details/731073

  • 14 martie 2012 17:04
    Proprietar
     
     

    Peter,

    I've marked your confirmation of a workaround as ANSWER. Not the best as you've said, but it's an answer to this thread.

    You can also voice this here if you think you can spin it as a 'suggestion'. Can't hurt to double-up. :-)

    http://visualstudio.uservoice.com/forums/121579-visual-studio


    Trevor Hancock (Microsoft)
    Please remember to "Mark As Answer" the replies that help.

  • 15 martie 2012 08:54