简体   繁体   中英

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

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 (eg 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

I use VSTS and it is fantastic. You can use GIT or TFS version control. Both are hosted by Microsoft. I prefer Microsoft due to the idea of long term support and reliability. You can see they are supporting VS 2008 to current.

https://www.visualstudio.com/team-services/pricing/

It is also free for up to 5 users.

From the link posted below. It has full support for many versions of Visual Studio

Q: Which versions of Visual Studio can I use with Visual Studio Team Services?

A: You can use:

  • Visual Studio "15"
  • Visual Studio 2015
  • Visual Studio 2013
  • Visual Studio 2012
  • Visual Studio 2010, requires Service Pack 1 and KB2662296
  • Visual Studio 2008 SP1, requires GDR update To connect to Team Services with
  • Visual Studio 2008 through 2012

Start Visual Studio. From the Team menu or Team Explorer, go to Connect to Team Foundation Server > Select Team Projects > Servers. Add your Team Services account ({youraccount}.visualstudio.com). Select your team project, and finish connecting. If you get connection errors, try choosing HTTPS as your protocol.

https://www.visualstudio.com/en-us/docs/setup-admin/team-services/connect-to-visual-studio-team-services

GIT Vs TFS Version Control - https://www.visualstudio.com/en-us/docs/tfvc/comparison-git-tfvc

One thing to look into is how you visualize editing and checking in code. I personally find that TFS version control follows a very simple and linear model. I prefer it to git. But its really Apples vs Oranges and usually people like what they are used to. I will say that Git currently is in active development and is not as feature rich as TFS-VC. Not to mention VSTS hooks into their entire ecosystem of plugins, build systems, test infrastructure and all of their cloud platform "Azure"

If you dont need to be sharing your version controlled stuff, I like TurtleSVN. Its simple and I like the UI it has for displaying modifications between versions. It adds a choice on the right-click menu of any file or folder in windows explorer for "TurtleSVN" and then all of the operations can be handled from there.

My Suggestion is still using TFS - I my project which is a product ( ASP.MVC application ) - we are using following structure in TFS..

we have a main branch - DEV branch a QA branch and a SP branch. See screen shot attached) 在此输入图像描述 Main Branch - Where all the code is merged using scripts - before we start with new version of development and then a new DEV branch with version is created from this main branch.. - so we have track of every version and new features added to each version... and For new client the code from Main branch is given.

Dev - Based on features added we create different folder for each new set of features / enhancements and put the version.

SP - After development is completed - the DEV branch is freeze and we create a new branch id SP and deploy the code for QA team - any defect founs are fixed in SP and deployed to QA - once testing is done the code is SP is freeze with QA approved and deployed to main and provided to Clients..

Finally using script - every thing from SP is merged in to Main.. and for new development - a new Branch in DEV is created from the Main.. This way we have track of enhancements / feature for each DEV phase and related SP is available and our product is getting developed in Main.

Hope this Helps..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM