简体   繁体   English

如何将C#更改从一个ASP.NET应用程序转移到另一个?

[英]How to transfer C# changes from one ASP.NET application to another?

We are developing Caisis (Caisis.org) -- open source clinical data collection system. 我们正在开发Caisis(Caisis.org)-开源临床数据收集系统。 Caisis is ASP.NET (4.0) (C# code behind) front end and SQL Server 2008 back end. Caisis是ASP.NET(4.0)(后面是C#代码)前端和SQL Server 2008后端。

Periodically, Caisis versions are upgraded. Caisis版本会定期升级。 For example, we have been busy developing on Caisis version 5.0, and now Caisis Version 6.0 has been released. 例如,我们一直在忙于Caisis 5.0版的开发,而现在已经发布了Caisis 6.0版。 We now need to transfer all our front & back end changes to Caisis Version 6.0. 现在,我们需要将所有前端和后端更改都转移到Caisis 6.0版。

Synchronizing differences between 2 SQL Server databases may be addressed using Red Gate SQL/Data Compare or open source DB tools like Open DBDiff. 可以使用Red Gate SQL /数据比较或Open DBDiff之类的开源DB工具来解决2个SQL Server数据库之间的同步差异。

However, as far as I can tell there are no equivalent tools (proprietary or open source) to synchronize 2 ASP.NET/C# applications. 但是,据我所知,没有等效的工具(专有或开源)来同步2个ASP.NET/C#应用程序。 Currently we are reduced to semi-automated approaches involving detecting differences between the 2 file systems using robocopy, then applying these changes manually. 目前,我们被简化为半自动方法,涉及使用robocopy检测两个文件系统之间的差异,然后手动应用这些更改。 Is there a more efficient way to do this? 有没有更有效的方法可以做到这一点?

I've been in similar situations. 我也遇到过类似情况。 The answer is simply: it's not an easy task. 答案很简单:这不是一件容易的事。 You can use a tool like Beyond Compare or Araxis Merge (Merge being more user-friendly, BC being more powerful, in my opinion). 您可以使用Beyond Compare或Araxis Merge之类的工具(我认为“合并”更加用户友好,“ BC”更强大)。 To do directory comparisons. 做目录比较。 With a little bit of configuration, you can have those tools hide all non-differing directory branches and files, leaving you with just a subset of differences. 只需进行一些配置,就可以使那些工具隐藏所有相同的目录分支和文件,而仅留下一部分差异。 Then you can use the file comparison feature of those tools to see exactly what changed in files and chose what to pull and what to leave. 然后,您可以使用这些工具的文件比较功能来准确查看文件中发生了什么更改,并选择要提取的内容和要保留的内容。

(Opinion) You should do this merge on a clean checkout -- that is, no outstanding files to check in. Then, after your merge is complete, have a single large check-in with just the upgrade merge changes. (意见)您应该在干净的签出时执行此合并-也就是说,没有要签入的未完成文件。然后,在合并完成后,仅进行一次大型签入, 仅对升级合并进行更改。 Then you have a way to rollback if you took too much, or if you missed something. 然后,如果您花了太多时间或错过了一些东西,则可以回滚。 You can roll back the changes, make the fixes, and try again. 您可以回滚更改,进行修复,然后重试。

My inclination if I were setting up a new project of this type would be to handle it via source control branching and merging. 如果我要建立这种类型的新项目,我倾向于通过源代码控制分支和合并来处理它。 I would pull in the original code for the product I am going to modify as my starting point (call it my core branch for the sake of discussion). 我将输入要修改的产品的原始代码作为起点(为了讨论起见,将其称为我的核心分支)。 Before making any changes I would then branch this for my development work (call this one dev). 在进行任何更改之前,我会将其分支到我的开发工作中(称为此开发人员)。 Continue from here with which ever branching strategy you prefer. 从这里继续,选择您喜欢的分支策略。

The key to what I am setting up is that I never make a change in the core branch, it remains true to the original release I am basing my modifications on. 我要设置的关键是,我从不对核心分支进行任何更改,这仍然适用于我基于其修改的原始发行版。 Then as changes to the original code are released I can apply them to my core branch. 然后,随着对原始代码的更改发布,我可以将其应用于我的核心分支。 From there I can merge them into my dev branch, and on through any other branches and to my release code as appropriate. 从那里,我可以将它们合并到我的dev分支中,然后再通过其他任何分支合并到适当的发布代码中。

Of course this approach hinges on two things: A) you use a source control system that does a decent job of handling branching and merging. 当然,这种方法取决于两件事:A)您使用的源代码控制系统在处理分支和合并方面做得不错。 B) you establish this branching structure at the start of the project. B)您在项目开始时建立此分支结构。

Setting this up after the project is already in progress would be quite a bit more difficult. 在项目已经进行之后进行设置会困难得多。 Some source control tools will allow you to establish a branch relationship between discrete code bases, but in my experience there are nearly always complications to doing so. 一些源代码控制工具将允许您在离散的代码库之间建立分支关系,但是以我的经验,这样做几乎总是很复杂。 For something that already has already been significantly modified from the original, Eli's suggestion is probably one of the better approaches. 对于已经从原始文件中进行了重大修改的东西,Eli的建议可能是更好的方法之一。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用asp.net C#将一个标签值传输到另一个标签以显示视频名称 - How to transfer one label value to another label for displaying video Name using asp.net C# 如何将ASP.NET网页从一台PC传输到另一台PC? - How to transfer a ASP.NET webpage from one PC to another? 如何从CheckBoxList获取选定项并将其转移到另一页ASP.Net C# - How to get selected items from a CheckBoxList and transfer it to another page ASP.Net C# 使用C#将数据从gridview传输到asp.net中的另一个Webform? - transfer data from gridview to another webform in asp.net using c#? 在 ASP.NET MVC 中将参数从一个 controller 传输到另一个 - Transfer parameter from one controller to another in ASP.NET MVC 如何在asp.net C#中从一帧传递值并在另一帧接收? - How to pass a value from one frame and receive in another frame in asp.net C#? 如何在C#(ASP.NET 2.0)中将值从一个类返回到另一个 - How to return a value from one class to another in C# (ASP.NET 2.0) 如何将SQL结果从一页传递到另一C#asp.net - How to pass SQL results from one page to another C# asp.net 如何在asp.net c#中将GridView的值从一个页面传递到另一个页面? - How to pass value of GridView from one page to another in asp.net c#? 从http传输到https asp.net c# - transfer from http to https asp.net c#
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM