Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I manage my projects versions using Visual Studio 2012 Professional

I am working on developing an asp.net mvc web application , using visual studio 2012 professional. now when I want to update my project, for example by adding new features, I do the following steps:-

  • I copy the project folder.
  • past it inside a "versioning" folder.
  • work on the original project , were I add the new features and code.
  • now if I want to revert my project back before the new features, I can open the folder inside the "Versioning" folder. and so on...

now my current approach is some how sufficient.. but I am trying to find a more automated approach where I can for example revert certain file let say a certain .cs file to its previous version , or revert back my whole project to certain point.

so can anyone advice how Visual studio 2012 can help me in managing my versioning ? Thanks in advance for any help.

Regards

like image 819
John John Avatar asked Sep 21 '16 23:09

John John


People also ask

Does Visual Studio have version control?

Version control with Visual Studio is easy with Git. We meet you where you are. You can work remotely with the Git provider of your choice, such as GitHub or Azure DevOps. Or, you can work locally with no provider at all.

Can you have two different versions of Visual Studio installed?

The term side-by-side means that you can install and maintain multiple versions of a product on the same computer. For VSPackages, that means a user can have several Visual Studio versions installed on the same computer.

How do I know which version of Visual Studio project I have?

You can find the VS Code version information in the About dialog box. On macOS, go to Code > About Visual Studio Code. On Windows and Linux, go to Help > About. The VS Code version is the first Version number listed and has the version format 'major.


1 Answers

You'll want to use a version control system like Team Foundation Server (TFS), Git, Mercurial, Subversion, etc. I personally recommend Git. Many of them have a means of integration with Visual Studio 2012 (for example, see How to Connect Visual Studio 2012 with git (github)?). Version control software supports features such as tracking file changes, creating code branches, merging code from different commits/users back together, etc.

Here's what a very simple workflow might look like with version control (see https://guides.github.com/introduction/flow/ for an example of the GitHub flow):

  1. You're ready to add a new feature/start a new version. For simplicity we'll assume you're working on a single branch (e.g. Git "master" branch).
  2. As you program, you make incremental changes to you source code and commit those changes regularly. Each commit gives you a snapshot of the work you've done and you can go back to any commit at any point and compare the changes between commits. The VCS you choose will influence how you synchronize those changes with a central/remote repository. You can even check revision history and look at previous versions of specific files and your code is typically backed up on another server for you without much additional work.
  3. When you're ready to release, you could tag a specific revision (or merge features branches into master, or ... etc.). Whatever the case, you can keep track of all the cumulative changes you've made for each release and be able to revert back to any point.

There are a few other steps you may consider for versioning such as updating the assembly information. In the AssemblyInfo.cs file there is assembly metadata specifying the assembly version, file version (or informational version, which I prefer). See What is AssemblyInfo.cs used for?. You can configure Visual Studio to auto-increment the version numbers.

Team Foundation Server should be available by default with VS 2012, although I'm vague on the details of setting up a TFS server to host your repositories. Visual Studio added direct support for Git (open source, very popular) starting in VS 2013, however there is an extension available for 2012 (https://visualstudiogallery.msdn.microsoft.com/abafc7d6-dcaa-40f4-8a5e-d6724bdb980c). The extension allows you to perform some of the most used Git functions such as committing, branching, and pushing.

Here are some links to get you started:

Why should I use version control?

Using Git with Visual Studio

https://git-scm.com/download/win

https://tortoisegit.org/

https://www.visualstudio.com/en-us/products/tfs-overview-vs.aspx

like image 150
Jacob Avatar answered Sep 28 '22 07:09

Jacob