I'm new with source control but since we are more than one developer in our company I started introducing git with Visual Studio 2013 Express and the Team Foundation Server. Now when I create a new project and add it to source control it seems that sometimes one random cs source file in the project is excluded from version control. In the Solution Explorer there is no check-in icon infront of the file. Also there is no other icon infront of it and if i publish the repository to the server the file isn't there.
I have no idea why the file is excluded and how to include it.
Related
Im using VS 2013 (CE).
Windows Server 2012 with a local install of Azure DevOps.
I can connect to the repository via the URL
http://example.local/DefaultCollection
Under defaultCollection i have another few test projects i.e.
/DefaultCollection/A-Project,
/DefaultCollection/B-Project.
For this example i will user C-Project which im trying to add to source control.
All im trying to do is add a project to this source control but i am experiencing issues that i would have thought shouldnt exist:
In VS2013, I add a new solution. I right click the project and select "Add solution to source control". Immediately it selects the project A-Project with the path /DefaultCollection/A-Project/C-Project. I dont want this as it resides inside another project.
From the web portal i create a new project and select Team Foundation Server (not Git as the examples online i have seen all select Git). In VS i create a brand new project and then attempt the same as 1 above but it tells me that i already have a project with this name under source control. I expand A-Project and i see it listed and undo any changes but it still doesnt add as i get some form of error.
Other problems range from the local version not mapped to, existing file exists/under source control to other errors.
What is the correct process to add a project to Azure Devops when using Visual Studio 2013 CE?
The default steps are described here: Set up Team Foundation Version Control on your dev machine.
You have to:
Create a workspace from the target project.
Copy your project into the locally mapped folder.
Add your project to the source control.
As workaround:
Create workspace from the target project: Create and work with workspaces
Copy your project into the locally mapped folder.
Add your project to the source control by: Manually add files to version control
Open the project and fix source control bindings:
Useful document: Add files to the server
I'm working on an ASP.NET MVC project in Visual Studio 2015 Community, using git as the VCS via Visual Studio's built-in git support in Team Explorer.
Whenever I edit a file, the edited file shows up in Team Explorer's Changes list as expected, but the website project's .csproj file is also added to the Changes list. Note, this happens when I just edit a file (e.g. a JavaScript file) in the project, without making any changes to the project itself (like adding/removing a file).
Clicking the Stage All button will stage the file I've changed, but not the .csproj file. Diffing the .csproj file in Beyond Compare reveales that (as expected) it's identical to the previous version. Nothing has changed (not even the line ending type).
The only way to clear the .csproj file from the Changes list is to right-click and Undo Changes.
It's not a critical problem, it's just annoying. Any idea why this is happening and how I stop it?
(Environment details: Visual Studio 2015 Community Update 3, ReSharper Ultimate 2016.1.2, both Windows 7 and Windows 10)
This issue is fixed in Visual Studio 2019 version 16.8.2. As per this link from Visual Studio developer community.
Is there any way to show linked files after a VSS to TFS migration? Additionally, how do you link files in Visual Studio 2013?
As Edward Thomson wrote, there is no such thing as linked files. Excerpt from How To: Migrate Source Code to Team Foundation Server from Visual Source Safe.
The main issues that you are likely to encounter are due to some differences in the way TFS handles version control in comparison to VSS. For example, because TFS does not support sharing of files, shared files are migrated by copying the version of the file at the time sharing began to a destination folder. Also, because branching in VSS uses sharing, the migration of a branched file results in the file being copied to the destination folder in TFS source control. As TFS does not support pinning, to help you locate items in TFS source control that were previously pinned in your VSS database, the VSSConverter tool labels any file that was pinned with the “PINNED” label.
I have some source code and other artifacts such as images that are not created in Visual Studio 2010. I want to put them into TFS 2010 version control, how can I do this?
TFS does not care what the format of your files is; you can use TFS to store any type of file - whether it was created in Visual Studio or any other program. This is true of all TFS versions.
The comments already somewhat address how to add a file to Source Control using Source Control Explorer; Once you have a workspace mapping, copy files or folders into a mapped folder in your workspace, right-cick on the folder you added the file to in Source Contol Explorer and select the option to Add Items to Folder; This will launch a wizard that you can use to let TFS know that you want to add the selected file(s) or folder(s) to source control - it can be any file on your computer.
After the files are added, check-in yor changes by right-clicking on the file in Source Control Explorer or by using the Pending Changes window (View menu -> Other Windows -> Pending Changes). Almost every source control operation in TFS is a 2-phase commit that involves first letting TFS know what you want to do (like add or delete a file) and then actually committing that change with a check-in.
You can also perform these steps using TF.exe from the command line or the Shell Integration Feature that is installed seperately with Team Foundation Server Power Tools (TFPT). Please note that whilst you can list and view the contents of files in TFS using the Web Access user interface, you cannot check-in or check-out files using that interface. Also, you will not be able to perform any source control changes without Visual Studio or at least a free version of it, named Team Explorer.
The only qualities of files that matter to the behavior of TFS are if the file is a mergable file type or not and what the encoding of the file is; however, in most cases the default setings in TFS will be fine for you. Mergeable file types are files that TFS will enable merging for; Examples of mergable file types are text files; Non-mergeable file types are file types that you would not want to merge, like pictures or Microsoft Excel files. You can read more about Managing File Types on the Microsoft site.
We use Codesmith to generate some code, and when we open up the projects, the files are there, in the solution, but there is no way to check them in. The DLL compiles just fine. The only difference to the .csproj is the addition of any new files we generated.
But unlike VSS, TFS, does not detect these files. I validated this behavior by editing the .csproj manually. For some reason, the only way to add a file to TFS is through Visual Studio.
However, when I remove them from the project, and then include them, I get the usual yellow plus sign.
You can manually add files to Visual Studio, however changing your project file isn't the best way to do this. If your project is already under source control and the files you want to add are visible in the Solution Explorer window, you can simply right-click a file and select Include in project. The next time you check your code in, the items will be added.
Since you're using TFS 2010, check out the Team Foundation Server Power Tools extensions. This includes the Windows Shell Extensions which give you integration into Windows Explorer which let's you right click on files or folders and add the to TFS outside of Visual Studio. Very nifty!
Looks like it is not possible and the workaround is to batch-add all the files through PowerTools. Though this article/forum-thread is dated it appears to be helpful:
Adding CodeSmith generated source file in Team Foundation System