Visual Studio 2013 Pending Changes does not include newly added item - visual-studio-2013

I am currently start using Visual Studio 2017 along with Team Foundation Service that is why this question arise.
When I am working with Visual Studio 2013 and add new item to Solution and then do Pending changes from Team Explorer, It does not included newly added item to solution or project.
I have sample problem with same scenario in VS 2017.
Actually I want to work with TFS and Visual Studio 2017/2015/2013 but not want to bind solution. Only Team Explorer level binding I want to use.

If you create a new item and then check both in VS2013 and VS2015, please make sure you are using the same workspace for VS2013 and VS2017.
In source control explorer, check the workspace is same between VS2013 and VS2017.
In pending changes, also check the work space is same as the one in source control explorer.
If you create new items separately in VS2013 and VS2015, please make sure you add items by the same way and options.
For TFVC, there are many ways to add files to source control:
File option in VS. In VS -> File -> New -> Project, if you select Add to source Control, it will automatically add the new project in source control ( you can find in pending changes).
Source Control Explorer. If you add files or folder in source control explorer, it will automatically add the new items in source control.
Add files in the local map copy. If you add files by this way, you need to manually add files to source control, such as VS -> File -> source control -> add items to folder.

Related

Add existing files to visual studio project

I have a straightorward console application that I build using code::blocks. A client has requested a microsoft visual studio project to build it. So I downloaded and installed visual studio and created a project. Now I am trying to add my source files to the project.
Various online help pages say "Select project; select menu item "Add Existing Item" ( e.g. https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2010/9f4t9t92(v=vs.100). I cannot find "add existing item"! Add new item simply adds an empty file.
I tried dragging files from windows explorer onto the project, but this REMOVES the file from where it belongs - NOT what I want to happen.
Surely there must be a way to do this! Even without using alternative IDEs, different projects frequently must share common source code, so source files from one project need to be added to another.
The answer is to use File | New | Project from Existing code rather than simple 'New Project' when creating the project

Why does Visual Studio not know that my source is in TFS?

Every now and then when I add a new project to my solution Visual Studio does not register properly that the project is under source control in TFS.
Intially, all seems well. I check in and the project shows up in TFS. My workspace is a Server Workspace.
Next time when I change a source file in this project and try to save it, Visual Studio does not automatically check it out for me, but in stead warns me that the file is read-only.
When I open the Source Control Explorer, my files are there. When I right-click on the project in Solution Explorer and choose "Add to Source Control" I get the warning that the project already is in Source Control. The solution is on-line , therefore this question is different from Visual Studio isn't tracking changes, or checking out files from source control as I edit them.
This happens in VS2013 and VS2015.
How do I tell VS that the project is in TFS?
The solution is to add a few lines to your csproj-file:
Right-click on your project in the Solution Explorwe and choose "Unload Project"
Right-click on your project and choose "Edit xxxx.csproj"
Add the following lines in the first PropertyGroup. I tend to put then after the FileAlignment tag
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
Save the file
Close the file
Right-click on the project and choose "Reload Project"

TFS automatically checks out a project when loaded

This is very weird behavior of Visual studio and TFS. I am using Visual Studio 2012 and TFS 2012. We have a large number of projects and solutions in the source control.
Lets assume I have no pending changes.
Whenever I open solutions which are present on source control all projects are loaded. And not a single project is checked-out for edit. I can see lock icon with the projects in the solution explorer.
Now I create a new solution and add projects from the source control to this solution, I face weird behavior. Some of the projects are automatically checked out and I haven't did any change to it. And this happens to only few projects instead of all projects. If I call undo all pending changes TFS perform a undo but then calls checkout for the project.
What is the proper solution to it. And it happens only in custom solution (sln) which is not present in the source control.

Visual Studio 2010 cannot add existing item in C project

I have the source code and hope to add the file xxx.c to source files of the project created by Visual Studio 2010. However, the source file is still in the original location even if I right click add --->existing item. What is added is actually just a link. What is the simpe way to adding the item (but not a link) to the project?
Copy the source file into the same folder along with your other source/project files using Windows Explorer. Then use Add -> Existing Item.

TFS Error: Unable to determine the workspace for this solution

I get this error when trying to "Go Online" with a project on a Visual Studio 2010 ALM project.
The project was previously connected to a team project on Team Foundation Server (2010), but I had to reinstall both the SQL Server and the TFS installation and I guess all that information was deleted.
Now, I'm trying to get the project into a new Team Project on TFS, and the TFS gives me this error.
Any ideas?
Thanks.
What I ended of having to do was re-map the workspace within the Visual Studio 2010 IDE.
From the Visual Studio IDE Navigate to FILE->Source Control->Workspaces
You will see a list of workspaces. Create a new workspace that points to your local project directory and the location of the source control folder on TFS.
It will ask if you want to get the latest version from Source Control, select yes or no depending on which version of your code is the most up to date.
Changing the path for a new workspace folder was not an option for me since the source control repository was way too large to download again.
What I did was re-binding the projects within the solution. In order to do this,
go to FILE -> Source Control -> Advanced -> Change Source Control
Visual Studio will warn you that the binding of all projects will be removed, click ok.
After that click on the 'change source control' again and the list of all projects will appear as not connected. Choose the projects which were previously source controlled and click on 'bind' for each one.
Hopefully the bindings will be set automatically.
I had the same problem but I had to delete the 'solution'.suo file-
You have to rebind into the source control. First disassociate current project from the TFS by clicking on File-> Source Control -> Change Source Control.
And after that From File-> Source Control -> click on Add Website/Solution to Source Control.
To resolve this error File->Open-> Website -> From the left panel click on Source Control and Select specific TFS project.
After selecting specific folder, click on "Run as IIS Website" checkbox .

Resources