I'm trying to add existing solution to source control in TFS 2012.
While trying to checkin(add) whole solution I get bunch of errors saying that it Could not find file like .config .gif .datasource .xsd.
Solution is quite big - over 100 projects, removing or undoing changes for all those files from source control will be messy. Moreover I'm not sure if removing them from source control wont break whole solution.
Is there any way to avoid that kind of problem?
The error you have is mainly caused when you're trying to check in files which is no longer exist on the machine.
To remove these changes from the list, you can either delete the nonexistent files from solution explorer, or go to Source Control Explorer -> select these missing files -> Undo Pending Changes. Or you can just left these files in the Excluded Changes list to not checking them.
Related
Coming from a Unix background and used to working with the Makefileto build stuff, I now have to find my way through the maze of twisty little passages known as Visual Studio 2017.
Basically: I just want to save a solution that I've imported into Visual Studio 2017 (e.g. to move it to another machine) to some sensible structure. I am unable to figure out how to do that!
The solution I work with comes from GitHub and the package is about 590 Kbyte and consists of 32 files. (I downloaded the .zip and unpacked it, then opened in the IDE by clicking on the .sln-file.
After running it (unchanged) in Visual Studio, it has ballooned to 4 Mbyte and 134 files. Obviously a lot of temporary files has been created as a result of me running it. Making a copy of this bloated directory structure is not practical - and some other way (i.e. the method for saving used by the guy who shared his solution on GitHub) must exist.
I want to save it with all those temporary files removed.
There is Build » Clean Solution – but it does not seem to get get rid of the temporary files.
I've also tried: File » Save all. I do no understand how this commend is supposed to work. It does not ask where to save tings, but just says "Item(s) saved" at the status bar at the bottom of the screen. Looking at things in the file system, I am unable to located anything saved. To me, it looks like this command does nothing.
I've searched, but so far found nothing for Visual Studio 2017 (recipes for older versions does not seem to work anymore.)
Saving a solution is something developers do a lot, so there must be something obvious I've missed.
There is not really the concept of "Save As..." for a solution. If you want to copy the whole solution elsewhere you would usually just copy the whole folder it's in to somewhere else.
The reasons you have many extra files are:
There will be a .git sub-folder which contains the Git repository. If you don't need to retain any link to this, you can delete / avoid copying this. Depending on how much history is in the Git repo this folder can even be much larger than the solution itself.
VS will create a .vs sub-folder for various housekeeping activities; you can usually avoid copying this.
In each project's folder, after you've built the solution, there will be obj and bin sub-folders. These are recreated as needed at build time and are not needed for a copy.
If you copy everything ignoring the above, you will probably find the size of the target is more as you were expecting.
I'm working on a project where I'm writing a library. I have a file, lets call it... tester.cs which I use for testing the library. Now, I'm only supposed to check in the library but i accidentally also checked in tester.cs. Is there any way I can delete it from the remote server without deleting it locally? and also ultimately removing it from source control? Thank you in advance.
If you want to delete files on the TFS server and leave them locally. There's the obvious brute-force solution of copying the files to a temporary location, fixing source control, then adding them back in to your project.
And also here is a similar question for your reference: How to delete a file from TFS repository without deleting local file
It depends really on what you mean by 'delete'. TFVC has the concept of delete which flags a file as deleted in the Project Collection database (and removes it from your workspace etc.). And you have the concept op 'destroy' which means the file will be removed from the Project Collection databases, and action that is unrecoverable except by restoring a backup of TFS. But this will leave your local file in place and erase all traces of the file in source control.
However, if you added it to your project in VS (.proj file) then there will be a reference to the file in there as well for compilation etc. This will cause issues when other users perform a Get-Latest of your solution.
Also if you are using a local workspace you can use .tfignore files to prevent such files from being added into the local workspace in the first place. See this page, near the bottom there is some information about the .tfignore file and how they work.
I think it's as simple as making a local copy of a file, deleting it in TFS and moving the local copy back to the original location. Visual Studio does not allow you to do that in a C# project or Source Control Explorer.
We recently had to do some refactoring, implicating that we had too move some files.
So in one branch, we did all thoses changes. In the trunk, we continued to work normally, but it appears that when merging, it causes a lot of troubles, since the files appears as removed on the old position and added to the new, making the merge very hard.
What is the correct way to proceed when moving file in the solution?
If you move a file inside a Project that is "bound" to source control, it should be recognised as a "Move" operation, and not do an Add/Delete. If the project isn't bound it might not work correctly.
If you are moving files between projects, you have to unload the Project/Solution and move the files in Source Control Explorer. This can be a bit tedious as you can only move one file/folder at a time*. Then you have to reload the projects and Exclude the files from the old one and Include them into the new one.
*There is an extension that allows you to move more than one file at one called TFS Source Control Explorer Extension.
I'm in the process of adding a WIX project to my solution and I'm using HEAT to create the files list. I've been having trouble getting builds to work unless the files list(wxs) is checked out.
I came across this tutorial and it says:
"If you have source control you have to include the FilesFragment.wxs
into your project but remove its source control binding. "
Is this possible in TFS 2010 with VS2010?
Click/Select on the file.
In VS, go File Menu / Source Control / Exclude file from source control.
This method only allows you to do this one file at a time.
The file will still be in your project and will not be under source control.
I don't like dynamically emitting installation authoring at build time for abouta dozen reasons but if you really are going to do it, perhaps you should consider checking it out and checking it in so that you have some histroy of what actually happened from build to build.
Otherwise if your installation behavior changes from one build to another build in an unexpected and undesirable way, you really aren't going to have any tracability other then diffing MSI's as to what went wrong.
If I add a new file to a project under TFS source control, it will check out the project file and the corresponding .vspscc file for that project file.
The project file itself changes (to include the new file), but the .vspscc file doesn't change at all. Why bother checking it out? Is there a way to disable it from being checked out and if there is, should I?
It gets checked out because under certain conditions it will be modified..and thus they checked it out as a matter of default. I wouldn't worry about it..it's not hurting anything, and if you disable it, it might bite you badly in the future in a bizarre way.
According to this post of Ben Ryan:
Team Foundation uses these to store lists of files that have been excluded from source control. We leveraged some of the existing SCC integration layer in Visual Studio to integrate Team Foundation, and these files were one of the carryovers. I'll have to check into what the logic was in breaking out these SCC settings into separate files as opposed to putting them in the solution and project files' SCC sections.
This file is a holdover from past VSS/TFS implementations, like Paulo Santos posted.
On the solution level, I have found no functional use for these files. In 10 years of using TFS, I have never seen that file altered. You can delete these .VSSCC files, as I commonly do for my closed source solutions.
But if you delete the solution-level .vsscc file, you will get a non-destructive error message on the first time open of the solution file...only after a new branch is created. All subsequent solution opening will not show the error message again.
My TFS setup standards have the solution file alone in the root folder, all projects are under sub-folders. Since those .vsscc files double the number of files in my root, I always delete them.
On a project level, I leave those files, as my team never opens project files directly, only solution .SLN files.
For my team, I prefer programmer ease of opening solutions over that one-time error message.