How do I add existing library files into TFS? - visual-studio

I am new to TFS and I'm trying to add some custom library files that the whole team uses into Team explorer in Visual Studio. It's library files of Sahi Testing tool so that any changes made to the files can be seen on all machines. I have tried searching online but could not find exactly what I want. Help

Basically, you have the following options:
If you have Nuget Packages for the libraries, you do not necessarily have to add the packages to source control and restore them when you need them. See this link for details.
As an alternative, you can add libraries as binary files to source control so that each developer or build server can retrieve them together with the source code. It's a good practice, to add them to a special location so that they are located in one place and not spread over the solution. However, only use this approach for binaries that do not change too often. Otherwise, you might bloat your TFS database if the files are large and change very often.

Related

How to find usage of code when projects are NOT added into one solution under visual studio 2010

I have a ASP.NET project that consists of many C# libraries in addition to the web project. The problem (for some reason) is that all projects that make up the web application are NOT added into one solution within a same visual studio. Instead, most projects are separated within individual visual studio. All projects are stored in source control, and shared by other developers.
Thus, the question is that how to find usage of any code, like "Find Usage" via Resharper. Is there any tools or tricks that allows me to do that like Resharper's Find Usage.
Any advice?
It looks like you're in something of a bind. My suggestion would be to simply make your own source control branch, and in that branch, you can create a new SLN file, add all of the projects, replace their binary project references by project references and then call Find Usages. Then, if you need to do any changes on the basis of Find Usage info, simply merge those in without merging PROJ or SLN files.
If these library projects are referenced as DLL files rather than the project references the only way is to open all the one-project solutions and search there by 'text'. There are some tips/tricks, which could simplify navigation a bit.
P.S. The situation you described looks far from convenient. I agree with Dmitri - you might consider to discuss with your team to switch onto referencing projects rather than using binaries. Once you switch each developer will be able to create local either solutions with the projects involved, or maybe you will agree on new common source controlled solutions.

Version Control: Visual Studio Project Support

We currently have a number of C++-based products that build under Visual Studio, and are maintained under MKS.
In order for our automated build system (which comprises a number of custom scripts) to increase the version number of the software it must first determine if any of the files within the project have been modified since the previous build.
The current method for performing this check is to check for changes to files in the directory tree below that containing the Visual Studio solution. This works well enough, but it completely misses those files that reside in other, e.g. shared/common, directories and have been added to the solution as existing items.
I know that this must be a common issue, so I'm wondering what are the usual techniques for managing this sort of thing. I realise that one option is for there to be no common source files, and instead have shared libraries, but that is quite a long way from the current reality. What I'm hoping to find out is that for A.N.Other source control system there are plugins that 'support' visual studio solution/project files, and will check for changes in the files included therein. I think if I had that ability then the problem will go away.

VS2010 MV3 - How can I share files between solutions?

I am the only developer for an application. All the files for this application are stored on the same computer and I am using Visual Studio 2010 Ultimate.
The application has three solutions and these share common items such as some stylesheets, some javascript and shared views.
It's starting to become difficult when I change one file as I have to copy this to the other projects in the other solutions.
Is there a simple way that I could share files. Something that would help me be more productive. Possibly even some single user source code or a way of linking files between solutions.
Hope I can find someone to help me make my life easier.
Robert W
Even if you work on your own I would suggest some kind of Source Control System. Team Server is now free with Visual Studio or you can use open source tools. Like this you can link to source files in other projects and you can reuse your files.
Use Source Control! SVN is free so is TFS with Ultimate.
If its web based files (javscript, pictures, css, etc) use a virtual directory to point to the common code directories.
if its compiled code (C#,VB, etc) you can link the files. When adding an existing file in the dialog it will have a open button, with an arrow down. click the arrow down and "add as link" will be available. It will then use relative referencing to the other file. I use this technique for a SolutionAssemblyInfo.cs file.
I would recommend placing the common files in the same directory as the solution file or no more than 1 folder deep.

Why do Version Control Systems lack the sharing functionality of Visual Source Safe and what source control do you use and reckon is worth trying out?

We are looking for a Version Control System to change our current Source Safe one. We are using it along with Visual Studio. We've failed so far - and the main reason for it is that all the alternatives we see doesn't support one or more features of VSS, especially one that we use widely - file share! What's up with that?
Alternatives like Source Gear claim to support them, but I gotta tell you that they do that very poorly. Not to mention that they are way slower than Source Safe, and have even more bugs.
What alternatives we do have to source version systems that do support file share? Or is there a reason to not use features like this? Please share your experience and support your comments.
EDIT:
By Share File I mean that I can checkout a file from any project that is sharing it, do some changes and then all get the latest version. It is very useful when working with C++ projects, or even C# Web Projects. I want to be able to share a file without the need to make another library for that.
From MSDN:
Sharing Files or Projects
Visual SourceSafe has a Share command that allows sharing of files or projects. For use of the command, see How to: Share an Item.
When you request file sharing, Visual SourceSafe creates a shared link between the versions of the file in the projects that share the file. When you check in the file to one of the projects, your changes are automatically checked in to all the sharing projects. All the projects that share a specific file are listed in the Links tab for the file.
When you share a Visual SourceSafe project, you create a completely new duplicate project under the current project. All the files in the new project are shared with the corresponding file copies in the shared project, and changes in one are reflected in the other during check-ins to the Visual SourceSafe database.
Other tools do have similar concepts, though not always with the same name or exactly the same semantics. Off the top of my head:
Subversion externals
MKS SI (shudder) calls them shared sub-projects
I tend to avoid them because it indicates there are some other issues with my project. If the resources are needed across many projects, I package them as a library and set my other projects to depend upon that artifact (using a dependency management tool such as Maven or Ivy to manage the dependencies)
In Subversion, you can share a whole folder (and its subfolders of course) with the svn:external property.
And since version 1.6 you can also share files.
In Git, those are called "submodules" - not sure if they work for single files though.
This post http://blogs.msdn.com/ericlee/archive/2006/07/20/sharing-files-in-team-foundation-server.aspx shows how you can accomplish the same thing with Visual Studio and TFS.
In StarTeam you can share files across projects.
I apologize if this is not really addressing the original question but depending on your will to "change mindset" for which version control system to use I would strongly suggest moving to a distributed one such as Mercurial or Git. There are plug-ins for Windows Explorer and Visual Studio for both.
As to specific features such as VSS-style file sharing I suggest setting up a Continous Integration environment like TeamCity and configure it appropriately.
It's a steep curve at first but awesome and time-efficient once your staff and servers know what to do.

Adding Visual Studio Project references to SVN

I checked in a project to SVN with about 15 references from one dev box then checked out the same project on a second dev box but most of the reference files are missing. Is it possible to checkin the reference files automatically?
Version control will only keep track of the actual files underneath the working folder. If the third party libraries are installed elsewhere on the machine, they will not be included in the source control at all.
You'll have to do one of these:
Ensure that the 3rd party libraries (eg, nunit, enterprise libraries) are installed on all required development machines.
Don't install the libraries using the normal installers at all, instead, add the individual dll's and other resources to source control as Vendor Branches, then bring them under your project by either branching them into your project location, or by adding an svn:externals definition.
Copy the required reference files under into your source locations, add them to source control and reference them from there.
I think it's hard for Visual Studio SCC tools to determine wether or not these files should be automatically added. If you're using the first scenario Jim T described, you definitely don't want that to happen.

Resources