Asp.net中的版本控制 [英] Version Control in Asp.net

查看:85
本文介绍了Asp.net中的版本控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI,



我是.net的新手。



我想添加版本控制设施到我的应用程序,你能建议怎么做吗?





再次感谢



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

推荐答案

请你更具体一点吗?



你的意思是你试图将你的解决方案添加到版本控制中,或者你想要为你的应用程序添加版本控制工具?



如果两者中的后一个,那么还有第二个问题,那就是你想要你的应用程序与版本控制系统(如SVN)进行交互,或者您只是想实现页面创作的版本控制或类似的东西。



Shawty
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


@ Chill60 - 我会记得谢谢。



到OP -



好的,所以在您的应用中添加SVN功能,这并不容易。我的意思是,如果您只是想跟踪您的应用程序版本,那么您可以从项目属性中由编译器管理的版本中读取程序集中的元数据(假设您使用的是.NET)(双击属性,单击应用程序,然后单击程序集信息)VS帮助有更多信息,但在需要的地方使用*将让VS和编译器在每次构建时根据需要增加它。



我没有代码可以提供,但是读取这个值并将其显示在某个地方并不困难。



现在如果你真的在谈论它为您的应用程序添加适当的SVN功能,以便您的应用程序可以与SVN服务器进行交互,有很多方法可以实现。



由于大多数SVN工具都是命令行驱动的,因此您可以根据需要使用.NET进程对象来调用各种命令行程序(如果您查看NuGet,请参阅下面关于tortoise SVN的说明)还会找到一些可以帮助你的软件包,即SharpSVN(只需将SVN放入你管理的NuGet软件包对话框的在线搜索框中)我不能告诉你个人如何使用它们作为Iv' 从来没有试过它们,但它们看起来很丰富。



最后,在应用程序中使用SVN是可以的,但是你需要了解它是怎么回事在你开始尝试操作它之前有效,所以本文的其余部分将描述如何在VS下安装它,这样你就有了自己的本地设置。



如果你使用TFS作为你的版本库比你已经指出的那样,它非常容易,你只需要使用内置的VS菜单并按照各种向导说明,对我和我正在使用的版本,这意味着点击Team并添加到Team Foundation Server,对于你来说可能会有所不同,但菜单应该很容易找到。



如果你不使用TFS那么事情变得有点棘手。


首先,您使用的是哪个版本控制服务器?在执行任何此类操作之前,您需要某种源控制服务器。我自己个人使用视觉SVN,他们在他们的网站上有一个免费的社区版本,谷歌会很快找到它,它很容易安装,只需按照向导,添加一些用户和你的好去。如果你不想使用SVN,那么你可以使用Git,但我不能帮助你,因为我不使用Git。然而,Syncfusion有一个很好的免费电子书关于这个主题,谷歌将很快找到它。



一旦你安装了版本控制服务器,那么你需要一个客户。与服务器一样,我选择的客户端是可视SVN。但是,我不知道您是否可以免费使用它,您需要检查您下载服务器表单的同一站点。 (我支付我的副本所以我有一个完整的许可证) - 无论哪种方式,运行安装程序(确保你没有打开visual studio)并按照向导。你还需要下载并安装适当版本的TortoiseSVN(严格来说这不是必需的,SVN客户端可以做你需要的一切),你使用Tortoise进行Windows资源管理器交互,这样你就可以在文件浏览器中看到图标显示文件状态,因此您可以浏览您的存储库。



安装好所有内容后,您需要启动可视SVN服务器管理器,为您创建存储库项目,为谁/不允许访问它分配用户和安全选项(VisualSVN网站上的文档非常好)。



之后创建存储库,启动visual studio,启动项目,然后在对其进行任何工作之前,右键单击它的父文件夹和Checkout。这会将您的项目附加到您在所看到的对话框中指定的存储库。



完成此操作后,您只需右键单击父文件夹(或使用Visual SVN添加到VS的工具并提交您的第一组更改。如果一切顺利,那么您应该看到您的版本1.从那时起,处理您的项目并定期提交更改。每次你提交新版本都会被创建。



我强烈建议您为所有项目选择一个好的布局模板,然后在每个项目中强制执行你做的项目。通过这样做,您可以保持项目资源整洁,易于在SVN中管理,它还可以帮助您可视化您的体系结构。如果您想要组织项目的一些想法,请参阅You-Tube上的lidnug演示频道中的视频,网址为http://youtube.com/lidnug



ONE Last小点(这是所有那些匿名的懦夫,他们用快速的手指和太多的黄色肚子非常快地留下评论告诉我他们为什么要投票给我!)



如果你要向某人投降,有勇气站出来告诉他们为什么,而不是一个萎缩的小紫罗兰,它击中了'downvote并逃跑。你不聪明,不酷,它让你看起来像个傻瓜。其次,如果你是贬低人,那么礼貌地等待他们完成输入他们的答案,然后再尝试让自己看起来像一只优秀的猴子!



干杯

Shawty
@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


这篇关于Asp.net中的版本控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆