Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
3.00/5 (4 votes)
See more:
HI,

I'm new to .net.

I want to add version control facilities to my application, Can you please advice how to do it?


Thanks again
Posted
Updated 13-Mar-13 3:13am
v2
Comments
[no name] 13-Mar-13 8:43am    
You do not add version control to applications. For Visual Studio it's Tools->Options->Source control.
Anuja Pawar Indore 13-Mar-13 8:59am    
The question is not clear... If you need help you have to be clear with your requirement, people can't guess and answer
[no name] 13-Mar-13 9:16am    
As stated, "add version control facilities to my application" does not make any sense. What does that even mean? You add version control to your IDE not to applications.
Srusti Thakkar 13-Feb-17 2:54am    
Have you find solution for that?

Can you be a bit more specific please?

Do you mean your trying to add your solution to version control, or you want to add version control facilities to your application?

If the later of the two, then there's also a second question, and that is do you want you app to interact with a version control system such as SVN, or are you merely wanting to implement version control for page authoring or something similar.

Shawty
 
Share this answer
 
Comments
CHill60 13-Mar-13 8:24am    
You should really post this with the "Have a Question or Comment" link as this question will now no longer appear in the "All Unanswered" list. You might like to consider deleting the solution after posting the comment
Member 7676955 13-Mar-13 8:41am    
Hi Peter,

Thanks for your quick response.

I want to add version control facilities to my application, Can you please advice how to do it?


Thanks again
@Chill60 - I'll remember that thanks.

To the OP -

Ok, so adding SVN facilities to your app, that's not really easy. I mean, if your looking to just keep track of your apps version, then you can read the meta data in your assembly (Assuming your using .NET) from the version that's managed by the compiler in the properties of your project ( Double click properties, Click Application then "Assembly Information") VS help has more info, but using a * where needed will let VS and the compiler increase this as required each time you build.

I have no code to hand, but it's not difficult to read this value and display it somewhere.

Now if your talking about actually adding SVN capabilities proper to your app, so that your application can interact with an SVN server, there's lot's of ways you can do it.

Since most of the SVN tools are command line driven, then you can use the .NET process objects to call the various command line programs as needed (See my description's below on tortoise SVN) if you look on NuGet you'll also find a couple of packages that will help you , namely "SharpSVN" (Just put SVN in the on-line search box in your manage NuGet packages dialogue) I couldn't tell you personally how to use them as Iv'e never tried them, but they look pretty feature rich.

Lastly, it's ok using SVN in an app, but you do need to understand how it works, before you start trying to manipulate it, so the rest of this text will describe how to install it under VS so you have your own local set up.

If your using TFS as your version repository than as has been pointed out already, it's very easy, you simply need to use the built in VS menus and follow the various wizard instructions, for me and the version I'm using, that means clicking on Team and adding to Team Foundation Server, for you it may be different but the menus should be easy to find.

If your not using TFS then things get a little more tricky.

First off, what versioning server are you using? You need some kind of source control server before you can do any of this. Myself personally I use visual SVN, they have a free community edition on their site, Google will find it very quickly for you and it's really easy to install, just follow the wizards, add some users and your good to go. If you don't want to use SVN, then you can use Git, but I can't help you there as I don't use Git. Syncfusion however do have a nice free eBook on the subject, again Google will find it for you very quickly.

Once you have a versioning server installed, then you need a client. Again as with server, my choice of client is the visual SVN one. However, I don't know if you can use it free or not, you'll need to check the same site you downloaded the server form. (I pay for my copy so I have a full licence) - Either way, run the installer (Make sure you DON't have visual studio open) and follow the wizard. You'll also need to download and install an appropriate version of TortoiseSVN (Strictly this is not required, the SVN client can do everything you need) , you use Tortoise for windows explorer interaction, so that you can see icons in your file browser showing file status, and so you can browse your repositories.

Once you have everything installed, you then need to fire up visual SVN server manager, create a repository for your project, assign the user & security options as to who is / is not allowed to access it (The documentation on VisualSVN's site is really good).

After your repository is created, fire up visual studio, start your project, then before you do any work on it, right click on it's parent folder and "Checkout". This will attach your project to the repository you specify in the dialogue you see.

Once this is done, you simply just need to right click on the parent folder (or use the tools that Visual SVN adds to VS) and commit your first set of changes. If all goes ok, then you should see that your at version 1. From that point on, work on your project and commit changes regularly. Every time you commit a new version will be created.

I would strongly recommend also that you choose a good layout template for all your projects, and then enforce it in every project you do. By doing this you keep your project sources neat and tidy, easy to manage in SVN and it helps you visualise your architecture too. If you want some ideas on organising your project, see my video in the lidnug presentations channel on You-Tube at http://youtube.com/lidnug

ONE Last little point (This goes out to ALL those anonymous cowards who are extremely quick with the downvote finger and too much of a yellow belly to leave a comment telling me why they down voted me!!)

If your going to downvote someone, have the guts to step up and tell them why, instead of being a shrinking little violet that hit's the downvote and running away. Your not clever, your not cool, and it makes you look like a twit. Secondly, if you are downvoting people, then have the courtesy to wait UNTIL they finish typing their answer, before trying to make yourself look like a superior monkey!

Cheers
Shawty
 
Share this answer
 
v2
Comments
[no name] 13-Mar-13 12:26pm    
I too am confused about the down votes here. This is a valid attempt to answer the question.
chadani 2-Apr-16 11:42am    
I may be little late here.But i found the answers of both of my questions about what i was trying to learn, after reading the appropriate answer by Peter Shaw though i was confused by earlier comments. Thanks Peter Shaw for the appropriate explanation!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900