经典的ASP和MVC并排侧,不同的项目? [英] Classic ASP and MVC side-by-side, different projects?

查看:194
本文介绍了经典的ASP和MVC并排侧,不同的项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试着问这在几个不同的方式,但让我们给它一个镜头(因为我还没有收到答案,这是推动我疯了!)

I've tried asking this in a few different ways, but let's give it another shot (as I've yet to receive an answer and this is driving me nuts!)

我有我要开始迁移到ASP.NET MVC一个非常大的传统的ASP 3.0应用(350K〜线)。我想保留旧的ASP文件从MVC的东西一个单独的项目。

I have a very large classic ASP 3.0 application (~350K lines) that I want to start migrating to ASP.NET MVC. I'd like to keep the old ASP files in a separate project from the MVC stuff.

如何调试这些想法?如果我只是转储文件放在同一个文件夹中,并创建两个不同的项目(一个WAP和MVC应用程序)引用每个所需的相关文件和文件夹?这应该工作,但没有人有更好的主意吗?我需要迁移应用程序的一小部分独立,因为这可能会需要一两年才能完成的能力。

Ideas on how to debug these? Should I just dump the files in the same folder and create two different projects ( a WAP and an MVC app) that reference the relevant files and folders required by each? This should work, but does anyone have a better idea? I need the ability to migrate small parts of the application individually as this will probably take a year or two to complete.

推荐答案

免责声明这是从我的头顶,我从来没有这样做,可能是这样没谱:

Disclaimer this is off the top of my head, I have never done this and could be way off the mark:

在初步审查,我想你已经3候补委员讨论如下:

After initial review, I think you have 3 alternates discussed below:


  1. 合并到一个应用程序,

  2. 有一个应用程序的根应用程序,另一个为子应用

  3. 复制到合并后建立一个应用程序(这也许是不可能的)

1)合并成1个应用程序为您提供了以下优点,比较简单,你需要修改在Global.asax - 设定你的MVC路线,国际奥委会等 - 的HttpApplication,会话和安全(假设形式基于)将只是工作。

1) Merge into 1 application gives you the following benefits, relatively simple you need to modify the global.asax - setting up your mvc routes, IOC etc – HttpApplication, Session and Security (assume forms based) will just work.

有一个有点小问题,而且是共享的TempData,这个你应该能够创建,如果你能,你页面上实例化一个SessionStateTempDataProvider(初始化加载,卸载,保存类似视图状态),我似乎找到了博客,但认为这是史蒂夫·桑德森的几个月前。

There is one somewhat "minor" issue and that is sharing tempData, this you should be able to create if you can instantiate a SessionStateTempDataProvider on you page (Init to load, unload to save similar to view state), I cant seem to find the blog, but think it was Steve Sanderson a few months back.

您的单元测试/ code覆盖面将是很难跟踪,你可能需要想​​办法来管理,这是一个完全不同的讨论。

Your unit testing / code coverage is going to be hard to track and you may need to think of ways to manage that, which is a completely different discussion.

2)使用此选项你将有一个新的继承一系列问题的应用程序完全分离。 HttpApplication的。*可能会导致一个问题,如果您的应用程序使用它,因为他们将引用不同的文件夹,上下文等,但忽略了,说明你是快乐的,他们是不同的应用程序

2) With this option you will have complete separation of applications with a new inherit set of problems. HttpApplication.* could cause an issue if your applications use it, because they would reference different folders, contexts etc, but ignoring that stating that you are happy that they are different applications

下一个大问题是让会议的工作,现在这可能被证明是非常棘手的,如果会话是INPROC那么每个应用程序将无法看到其他应用程序会话,但如果您使用的是SQL或自定义缓存服务器会话状态你应该能够在应用程序之间黑客无论是程序或引用/配置和共享会话状态 - 最坏的情况下,你需要编写自己的会话提供,(我从来没有写过一个,这样不知道有多难这将是或如果其甚至实用)。

The next big issue is to get Sessions working, now this could prove to be very tricky, if session is inproc then each application will not see the other applications sessions, however if you are using SQL or custom caching server for session state you should be able to "hack" either the procedures or references/configuration and share the session state between applications - worst case you will need to write your own session provider, (I have never written one so don't know how hard this will be or if its even practical).

接下来的问题是窗体身份验证,可以在标准的做单点登录,并确保将machineKey验证和解密密钥是在配置相同。温度数据将是相同的选项1.对我来说这听起来像的东西太多改变,是可行的......

The next issue is forms authentication, you can do standard single sign on and ensure that the MachineKey validation and decryption keys are the same in the configuration. Temp data is going to be the same as option 1. To me this sounds like too many things to change, to be viable...

3)假设你把你的asp.net网站,并添加一个引用MVC和在默认的全球ASAX添加路由等应用程序仍然应该建立干净,但扔路由错误寻找时/控制器/动作/ ID类型路线,所以你可能需要进行检查。

3) Assuming that you take your asp.net site and add a reference to mvc and add in your default global asax routing etc, the application should still build cleanly but throw routing errors when looking for /controller/action/id type routes, so you may need to check this.

假设的作品,你可以潜在做两个应用程序的XCOPY合并(即从MVC应用程序的所有文件复制到asp.net应用程序pre部署)。我知道你可以通过创建已经合并这两个应用程序的一大项目做到这一点,但这种方式code是在在构建过程中更晚的阶段结合起来。 (签名的程序集,浮现在脑海中的是麻烦)。再次,您将需要在临时数据的问题开展工作......

Assuming that works, you could "potentially" do an xcopy merge of the two apps (i.e. copy all the files from the mvc application into the asp.net application pre deployment). I know you can do this by creating one big project with both applications already merged, but this way the code is combined at a much later stage in the build process. (Signed assemblies, come to mind as being troublesome). And once again you will need to work on the temp data issue...

我还没有触及URL重写,你可能需要考虑,而且请注意,与每个你可能需要考虑的做法明显的缺点等诸多方面。

I haven't touched on url re-writing and many other aspects you may need to consider, and please note there are distinct disadvantages with each approach which you may need to consider.

要总结一下我认为你最大的问题将是一个HttpApplication,会话和TempData的从侧面MVC,查看来自asp.net端的状态。 URL重写,认证应该更容易。

To sum up I think that your biggest issues will be HttpApplication, Session and TempData from the mvc side, view state from the asp.net side. Url re-writing, authentication should be easier.

和作为阿甘说,这是我的有关想法。

And as Forrest Gump said, "That's my thoughts about that".

这篇关于经典的ASP和MVC并排侧,不同的项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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