问题描述
我们在Sitecore的6.5 Web窗体多站点项目需要体面的重构,重新设计的架构,我们要升级它Sitecore的8当然会更容易,开始一些全新的,但该项目是巨大的,可能这将是不可能的它重写到的MVC中,因为这将需要具有所有站点和运行时间完全新的解决方案。这就是为什么我们开始思考是否可以保留旧的解决方案,并添加有MVC项目,它可以让我们在编写新的MVC网站和重构慢慢传统code在其间。
We have a multi site project in Sitecore 6.5 Web Forms which requires decent refactoring, architecture redesign and we want to upgrade it to sitecore 8. Of course it will be easier to start something brand new, but the project is huge and probably it won't be possible to rewrite it to MVC in completely new solution because of time that will be required to have all sites up and running. That's why we started to think if it is possible to keep the old solution and add there MVC project which allows us to write new sites in MVC and slowly refactor the legacy code in the meantime.
我看到约翰西的职位有关使用Web Forms和MVC在一个单一的解决方案,http://www.sitecore.net/learn/blogs/technical-blogs/john-west-sitecore-blog/posts/2012/06/using-web-forms-and-mvc-in-a-single-solution-with-the-sitecore-aspnet-cms.aspx但我需要肯定的是,不会造成长远来看任何问题,我们提出这个解决方案给客户之前。
I saw John West's post about using Web Forms and MVC in a single solution http://www.sitecore.net/learn/blogs/technical-blogs/john-west-sitecore-blog/posts/2012/06/using-web-forms-and-mvc-in-a-single-solution-with-the-sitecore-aspnet-cms.aspx but I need to be certain that it will not cause any problems in the long run, before we propose this solution to the customer.
有没有人有保留两个类型的项目,在生产应用经验?是否有可能做没有任何风险由sublayout sublayout迁移?我们可以在在网络表单和部分网站MVC(当然与网页分离,只有Web窗体或仅MVC控制)的一次一部分吗?你知道,我们应该知道的任何约束?
Does anyone have experience with keeping both type of projects in a production application? Is it possible to do a migration sublayout by sublayout without any risk? Can we have in one time part of the site in web forms and part in MVC (of course with pages separation to only Web Forms or only MVC controls)? Do you know about any constraints that we should be aware of?
推荐答案
这的确是可能的Sitecore的WebForms和MVC共存相同的解决方案中。好像你有两个目标虽然这里应该分别对待。 1)从6.5至型升级Sitecore的8这是一个不小的任务,2)的WebForms转换为MVC。
It is indeed possible for Sitecore WebForms and MVC to co-exist within the same solution. It seems like you have two goals here though which should be treated separately. 1) the updgrade to Sitecore 8 from 6.5 which is not a small task and 2) conversion from WebForms to MVC.
假设重新写是不可能的,我会得到升级到Sitecore的8(甚至更好8.1)的解先启动。如果您现有的解决方案使用DMS,那么这将是除了升级的其余部分显著的工作。
Assuming a re-write is out of the question, I would start first with getting the solution upgraded to Sitecore 8 (or even better to 8.1). If your existing solution uses the DMS, then this will be a significant job in addition to the rest of the upgrade.
在你有一个工作的WebForms解决方案升级到Sitecore的8 / 8.1,那么你可以考虑一下改变解决MVC的一部分。 WebForms和MVC可以愉快地共存一个项目内,唯一的限制是,每个页应该是100%的WebForms或100%的MVC。创建布局的MVC版本将是首要任务,其次是你的组件。这可能是你在转换过程中,你可能会存在重复的标记,但不应该是一个主要问题。如果你是新来Sitecore的MVC你会想了解可用的不同渲染类型和知道该作何用途选择(这里的,并指出有关的)。如果在你的解决方案的形式,我想最后的升级它们作为移动到MVC时,他们可能需要的最大的变化。
After you have a working WebForms solution upgraded to Sitecore 8 / 8.1 you could then think about changing parts of the solution to MVC. WebForms and MVC can happily co-exist within a project, the only limitation is that each page should be either 100% WebForms or 100% MVC. Creating an MVC version of the Layout would be the first task, followed by your components. It is possible that during your conversion process you could have duplicate markup but that should not be a major issue. If you are new to Sitecore MVC you will want to learn about the different rendering types available and know which to choose for what purpose (here is an introduction to Sitecore MVC presentation concepts and notes about moving to Sitecore MVC). If there are any forms in your solution, I would upgrade them last as they might require the biggest change when moving to MVC.
这篇关于是否有人在维护Sitecore的MVC和Web窗体在一个解决方案的经验吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!