TFS Show Latest on Top Level Folder - c#

I'm working with TFS for a bit now and my question is about a function in the Source Control Explorer.
A sample Folder Structure for my Project might be this:
Project/MyControllers/Controller.cs
I change something in the Controller.cs and I navigate to the folder "Project" inside my Source Control Explorer. There it says at the Column "Latest", yes. Which in my opinion isnt right, because i changed something inside the folder. When i navigate into "MyControllers" it says that my Controller.cs changed.
Is it somehow possible to see the "No" at the "Project" level?
I dont know if its important by my Visual Studio Version is 2017.
Thanks for your help.

This is the correct and excepted behave. The Latest column is used to show the mapping status between your local file in workspace and the correspondingly server file. Which include value such as yes, no ,not download , not mapped. It will not influence either subfolder or parent directory.
Only when the name of "Project" folder has changed such as "ProjectDone" by others and checked in, it will show the Latest status of Project with "No". This is a point to point mapping status.
And you don't have to always paying attention to the file is latest or not. In other words, you don't have to and can't make sure always working on the latest version. When you working on a file and some others make same change during you local working. TFS will record the changes and let you solve conflicts when you perform the check in action.
Usually you just need to do a get latest of the workspace or top folder in the beginning of the day of work on a project.

Related

how to undo pending changes of files that are unchanged?

One thing that drives me crazy with TFS is the fact that if you have a file checked out, but you made no changes to it, it still shows as a change, distracting you from real changes that you made. This is especially annoying when you use tools such as T4 to generate code, because most of the time the tool will generate the same code, but will leave the file checked out.
For some reason that I can't understand, Visual Studio insists in showing those as changes, and will even claim that there are conflicts if another person happened to check-in the same "changes".
Fortunately, the TFS Power Tools include a command that compares checked-out files with the server version and undoes the unchanged files. I will explain how to integrate it into Visual Studio using a custom tool.
This is unfortunately not available if you are using Visual Studio 2017!
It used to be very simple to accomplish this with earlier versions of Visual Studio:
tfpt uu /noget /r *
How do we remove files from pending changes if they do not have any changes?
This is different based upon your choice of version control system in TFS, so the above problem only exists for TFS' traditional version control system TFVC and not git which has been supported for a few years now.
For TFVS a partial workaround is to mark all files, right-click and Undo... and click Undo Changes button in the following dialog. This will prompt you for the files that are different (letting you choose No or No to All) but not for the ones that have no changes. Important: I write 'partial' because this approach does not work for file renames as the file is considered unchanged so the rename will be undone.
Yes,there are no Power Tools for Team Foundation Server 2017. You could use below workaround:
Right-click on your project ,select undo checkout, then just click okay, or whatever confirmation is left...
Then, while undoing checkout, for every file that has REAL changes in it, a prompt will ask you to confirm the check out for that file... simply click "No to All". Visual Studio will know if the checked out file has changes or none.
WARNING: This method also removes new files, i.e. files that are not yet checked in to TFS. If you want to keep these files then simply exclude them from the set of files you "undo".
You could also take a look at this question: his question Files listed as pending changes when doing merges that didn't change?
The TFSSourceControlExplorerExtension extension is available for VS 2017 and it has an undo unchanged action that works rather nicely.
Stage the change you actually want. The file that isn't actually changed then disappears.

How to check in (or upload) again a solution that i have on my local drive and manually deleted from TFS?

I'm using VS2017 and i have a solution on my local drive.
I had the same solution on my TFS as well, but i deleted it from the repository page manually.
Now if i want to check in the solution again i get a 'no pending changes' message, even if the TFS folder is empty.
I tried a few things but nothing seems to work.
I just don't know how to put these files on my TFS again and i can't find the help i need anywhere. Sorry if it's a duplicated question, i just can't find the answer to this.
Assuming you are using TFVC;
You need to sync (get latest) your local workplace with the server to see any further changes.
If you want to simply "restore" the solution, you can do an "undelete" through the source control explorer.
If do not want to revert your delete, you can get latest (which will remove any unchanged files) and then copy the "new" files over the same location. You will probably still have to and "Add Files" in the source explorer to re-pend them with TFS and then check them in.
In either case, make a backup of the files you are wanting to retain.
The simplest way is creating a branch from a Workspace Version, then check in the branch.
Please follow below steps to do that: (Backup the original project first)
Right click the project directory in Source Control Explorer >
Branching and Merging > Branch
Select Workspace Version for Branch from version By, then click
OK.
Check in the new created branch
Right click the Team Project name in Source Control Explorer and
Get Latest Version to sync delete the original branch (Backup it first).
Rename the new created branch to original one if needed.
Check in the changes
Check the remote server in page site, the project files/code will come
back.

Why won't the aspx file update on the server after a rebuild

I'm working on an asp.net web form. Today I did some changes to 3 files:
details.aspx
regions.aspx
regions.aspx.cs
I rebuilt and published.
One of the aspx files (details.aspx) hasn't changed. On the server, It is still showing as it was last modified a month ago.
I know I could simply overwrite that one file but I am trying to understand what I did wrong. Or is it to be expected from Visual Studio (2012) ?
In the publish window go to
Settings -> File Publish Options
and check off Delete all existing files prior to publish.
You could also manually clear all files from the publish folder then republish, but the setting takes care of it automatically.
Please make sure you have the BuildAction set to Content. Select the file in Visual Studio, press F4 and check the BuildAction property.
In my experience I wouldn't say it was to be expected. I'd try publishing to a new folder just to remove any risk of it just trying to publish updated files. I'd check that the Property on the page in VS is Build Content and not something funny that's causing it not to be copied.

How to i use TFS with Visual studio 2010 to simulate multiple users?

i'm using VS2010 with free version of the TFS provided with codeplex. but i'm only working on one PC. i tried to simulate two users by opening two VS and login to TFS from two user names. then when i add a project from source control by file -> Source control -> Add project from source control and browse till i find the .sln file, the local path was always the same for two users. it didn't even let me change the local path. because of this when i made changes from one user it made changes to the local solution also it updated solution in codeplex but when i tried to get the latest version from the other user it always said the local solution was edited and asked to override it. but i need to update the solution in VS from the server not from the local folder. when i said NO to override then clicked checkout for edit, it never returned the updated version on server. is there away to fix this?
I need to simulate two user using two instances of VS2010. Is there away to do this properly?
thanks
You had it right in you post, login using another user, but when you create the local workspace make sure they point to two (2) separate folders. Don't point the workspaces at the same place on the disk that will not work.
So user A's workspace would be c:\A\source
User B's workspace would be c:\B\source.
All the files will be replicated in both location. Now if you modify a file in A's workspace and checkin, you'll need to do a get latest from B's VS to it's workspace.
If you modify anything in either workspace you'll need to check it in for the other user to be able to get it their workspace.
Hope this helps,
ET
You can:
1) log out and login as another user
2) use hyper-v locally in Win8+ and spin up another machine
3) spin up a VS trial machene for free in Azure

SVN keeps corrupting files with "<<<<<<< .mine", how to fix?

I've got a Visual Studio C# project which is under version control (SVN).
I've always commited and updated the project without any problems. But a couple of hours ago Visual Studio throws the following error when I try to launch/rebuild the project:
Files has invalid value "<<<<<<<
.mine". Illegal characters in path.
I don't know how to fix this problem. What should I do?
That happens when svn encounters a conflict: You changed a file, the file on the server was changed and it cannot (easily) be merged automatically. You need to decide what is the correct solution now.
Subversion just adds the diff into your source file (and creates files next to it, called OriginalName.mine (unchanged) and OriginalName.rsomething (unchanged, server version)).
Fix the conflict and tell subversion that this is resolved.
just delete the obj folder and it will worked fine.
Remove the code that shouldn't be in the file throwing the error and remove the the three files with extensions .mine, .<somerevision> and .<some_other_revision>. svn updated files that now contain 'conflicts' and you need to resolve these conflicts by hand. Usually this means you edited a file, someone else edited the same file and checked in changes and you didn't pay attention when checking out the changed file.
Delete every thing you have in obj folder .
Remove your obj folder from svn version control . Because on every build it get updated and when other developer commit changes to solution SVN is unable to marge obj folder files and raise error
Files has invalid value "<<<<<<< .mine". Illegal characters in path.
Please read the Basic Usage chapter in the subversion book. It has a section about Merging conflicts by hand which explains the conflict markers you're seeing.
Removing the debug folders worked for me (see comment-not answer above).
I got this after moving 12 folders from one section of svn to a new section. So if you get this after moving a project and the error does not point to an actual file, this is likely your issue.
If you have AnkhSVN or VisualSVN installed resolving this is most likely as easy as right clicking the file in the solution explorer and selecting edit conflict.
This will open the changed file in your merge editor. (See Tools->Options->Source Control->Subversion User tools for AnkhSVN). With a good merge tool like the free to use SourceGear DiffMerge or TortoiseMerge, resolving the conflict is just a few mouseclicks away.
I have had this happen on a large scale where the files get marked resolved but the conflict metadata is still there. I wrote a regular expression for visual studio to find these, for instances where it is not feasible to simply revert the changed files.
http://www.codetunnel.com/blog/post/90/ever-merge-with-svn-and-mess-up-when-resolving-conflicts-read-on
I closed the IDE, then deleted the obj folder and restarted the IDE and rebuilt my Code. This worked for me.
Inside your project :
odj folder -> Debug -> project name.csproj.Filelistabsolute.txt(snb.csproj.Filelistabsolute.txt)
Inside the text file
>>>>>>>.mine and >>>>>>>.r150 occurs
to remove the things the program works
1)Just save your local changes whatever u have edited in the file
2)revert the file
3)update it from SVN
4)Paste your local changes
If you are using TortoiseSVN you should have a right click option on the file called Edit Conflicts. This should bring up TortoiseMerge which is able to read those obnoxious notations stuck into the file (really, to break your code so you KNOW there's an issue and don't blindly check it in).
TortoiseMerge will read it properly and present you with a 3-way merge. This was what I was looking for. Although it is true that it does also create the separate .mine and .rxxx and .ryyy files, and there are various manual and command-line ways to deal with all this.
Have a simple solution. just delete all file from debug folder and rebuild the solution, an error display on the screen "There were build errors. Would you like to continue and run the last successful build? click on "Yes" button. Now stop the program and run normally.

Categories

Resources