将(整体)经典 ASP 迁移到 ASP.Net

发布于 2024-08-11 04:28:31 字数 1317 浏览 3 评论 0原文

多年来,我的目标是从 ASP/VBScript 转向“更好”的语言 - 我更喜欢 C#,因为我有 C 技能 - 但我也会考虑其他语言(包括 PHP 等,所以不仅仅是 DotNet )

目标是拥有一种可以为我们做更多事情的语言的代码库。我讨厌 VBScript 中缺乏数据类型,我想要许多不同的“容器对象” - 而不仅仅是字典对象,等等 - 事实上我想知道为什么,在 80 年代从 Basic 转向 C,并且然后是 C++,过了一段时间,我设法“回到”Basic,进入 00 年代。

(我可以用 VBScript 对容器对象进行编程,但我的直觉是它们运行起来会很慢;我们有大量用于渲染页面的 HTML“片段”缓存,ASP 应用程序对象是一个相当生硬的工具!)

我的 ASP/VBScript 是一个大型应用程序,它基本上是一个交付 Web 内容的“引擎”。

它已经制作了很多年,现在 ASP 代码很少更改。 (所以我确实需要证明移动它的合理性,或者只是“永远”使用 VBScript)

它是由 MS SQL 数据库中的数据驱动的。

只有一个 .ASP 页(由多个包含文件组成)。

根据查询字符串参数从数据库加载页面的皮肤和 CMS 模板,并运行合适的数据库存储过程以获取合并到 CMS 模板中的数据。

还可以从数据库中检索有关页面的数据(使用的方法等)以及访问权限的详细信息等。

根据我读到的一些内容,这些事情可能会使迁移更容易:

不使用 ASP 会话 - 会话 cookie 用于从数据库检索会话数据(因此我可以轻松地与 ASPX 共享会话一半)

VBScript 使用 OPTION 都是明确的,因此所有变量都是

通过 Response.Write 进行预定义的(事实上,大多数内容都合并到单个变量中,然后输出)。

整个过程 一些 VBScript 类,但不是很多。

我有很多 VBScript 函数,还有一些子例程,

它可以从浏览器捕获屏幕截图并以图形方式将它们与主图像进行比较 - 因此我有能力进行回归。 我没有

资源进行完整的重写;在迁移过程中需要继续维护现有代码;但话说回来,我们 99% 的工作都在 CMS 或 SQL Sprocs 中,因此对 ASP 代码的更改并不频繁。 。

我读过 MS 将 ASP 代码迁移到 VB.NET 的实用程序 鉴于我的代码是 100% VBScript 并且没有 HTML/Script 的混合,我将不胜感激,这是否会对我有很大帮助或有一点帮助?

我很乐意重构 STAYING IN VBscript,以便以后更轻松地迁移到 DotNet(但我需要知道我这样做的目标是什么:))。例如,我可以将部分/所有功能移动到 COM 对象,并且可能可以逐步完成?

感谢您的帮助

For many years I have had an objective of moving out of ASP/VBScript to a "better" language - my preference would be C# as I have skills in C - but I would consider other languages too (including PHP etc. so not just DotNet)

Objective is to have the code base in a language which does more for us. I hate the lack of data typing in VBScript, I would like a number of different "container objects" - rather than just a Dictionary Object, and so on - in fact I wonder why, having moved from Basic to C in the 80's, and then C++ a while after that, I managed to move "back" to Basic in to 00's.

(I could program the container objects in VBScript, but my instinct is that they would be slow in operation; we have a significant cache of "snippets" of HTML used in the rendering of the page, the ASP Application Object is a pretty blunt instrument!)

My ASP/VBScript is a single large application that is basically an "engine" to deliver web content.

It has been many years in the making, and now the ASP code changes seldom. (So I do need to justify moving it at all, or just living with VBScript "for ever")

It is driven from data in an MS SQL database.

There is only one .ASP page (made up of several include files).

Based on the query string parameters Skin and CMS templates for the page are loaded from database and suitable database Sprocs are run to acquire data which is merged into the CMS templates.

Data about the page (methods to use, etc.) is also retrieved from the database, along with details of access permissions and so on.

From what I have read some these things may make migration easier:

ASP sessions are not used - a session cookie is used to retrieve session data from the DB (so I could easily share a session half-and-half with ASPX

The VBScript uses OPTION EXPLICIT throughout, so all variables are predefined.

All output is via Response.Write (in fact most content is merged into a single variable and then output). There is no mix of HTML and <% server code %>.

I have some VBScript classes, but not many.

I have lots of VBScript functions, and a few Subroutines.

I have a test suite. This catches screen shots from the browser and graphically compares them with master images - thus I have the ability to do a regression test.

I don't have the resource to do a complete rewrite; maintenance of the existing code needs to continue during migration; but having said that 99% of our work is in CMS or SQL Sprocs, so the changes to ASP code are infrequent.

I have read of MS's utility to migrate ASP code to VB.NET. Given that my code is 100% VBScript and no mix of HTML/Script I would appreciate opinions on whether this would help me a lot or a little?

I would be happy to refactor STAYING IN VBscript with a view to making the migration to DotNet easier later on (but I'd need to know what my objectives were in doing that :) ). I could, for example, move some/all the functions to a COM object, and could probably do that piecemeal?

Thanks for your help

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

初见终念 2024-08-18 04:28:31

我有一个大型 ASP 经典 Intranet,直到去年才维护,它已经很旧了,但 ASP 经典中仍在添加新的部分,因为已经投入了太多的库代码。如果您不经常更改 ASP 代码并且进行了某种形式的测试,那么您就已经有了良好的设置。 (我不得不承认这是我第一次听说截图方法)。如果一切都从数据库驱动并正常工作。不要打破它。

PHP 会给你同样的变体类型问题,但会给你一个充满选项和选择的世界,这使得 ASP 经典看起来像一个孩子的玩具。开箱即用的 PHP 可以完成我需要做的一切。

ASP.net 是一个大框架。正确、充分地理解它并不是一件容易的事,而且它常常让我感到惊讶。它试图自动为来自表单环境的开发人员做一些事情,当您来自听起来像您拥有的非常精确的渲染方法时,这些事情会变得非常引人注目。我发现自己一直在与技术作斗争,直到 ASP.net MVC 出现。它更适合我的想法,因为它的工作方式和执行我要求的操作,仅此而已。 C# 是一门很棒的语言,具有出色的功能,只要您能找到合适的部分,DOT.net 框架就可以让您做任何事情。其中有很多内容,您会发现自己偶尔会编写一些已经在框架中完成的东西,只是在完成自己的实现后才发现它。

实际上迁移可能会导致一些有趣的问题。尽管您可以像运行 ASP 经典页面一样运行 ASP.net 页面,但您将失去该环境的许多预期优势。话虽这么说,我确实做了一些测试,考虑将有问题的网站迁移到 ASP.net,并设法找到解决大多数障碍的方法,并得出这样的迁移实际上“只是工作”的结论。然而,进行这样的迁移需要大量的工时,这使得这项工作不可行。

就我个人而言,我不建议进行此类迁移,除非您已经成功完成了一些 ASP.net 项目,并且了解 asp.net 带来的问题。

我还没有看到您提到的 ASP 到 ASP.net 转换工具,但很想获得它的链接。

如果您仍使用 VBScript 并且不了解 AX (ASP Xtreme Evolution) 项目此处我强烈建议您研究一下它,以获取克服/绕过 ASP 的几个经典“限制”的灵感以及它提供的功能库。

I have a large ASP classic intranet that I was maintaining until last year, and it was getting old, but new pieces were still being added in ASP classic because there was so much library code invested already. You already have a good setup if you are not changing the ASP code often and have some form of testing in place. (I have to admit it's the first time I have heard of the screenshot approach). If everything is driven off the DataBase and working. don't break it.

PHP will give you same problem of variant types, but will give you a world of options and choices that makes ASP classic seem like a childs toy. Out the box PHP does everything I've ever needed to do.

ASP.net is a BIG framework. Understanding it properly and fully is not an easy task, and it surprises me very often. it tries to do things for developers coming from a forms environment automatically that get very obtrusive when you come from a very precise rendering methodology like you sound you have. I found myself fighting the technology all the time, until ASP.net MVC came around. It fit my mind better because of how it worked and did what I asked it to, and nothing more. C# is an awesome language, with brilliant features and the DOT.net framework lets you do anything, if you can just find the right pieces. There is so much of it you will find yourself occasionally writing something that has been done in the framework already, only to find it just after finishing your own implementation.

Actually migrating could lead to some interesting problems. Even though you CAN run a ASP.net page much like an ASP classic page, you will loose many of the benefits of the environment as it is intended. That being said, I did do some test towards looking at migrating the site in question to ASP.net and managed to find ways around most of the stumbling blocks and reached the conclusion that such a migration would in fact be "mere work". The sheer quantity of man-hours it would take to do such a migration though made the undertaking infeasible.

Personally I would not suggest such a migration unless you have a few ASP.net projects under you belt successfully and are aware of the gotchas that asp.net brings with-it.

I have not seen the ASP to ASP.net conversion tool you speak of, but would love to get a link to it.

If you are staying in VBScript and are not aware of the AXE (ASP Xtreme Evolution) project here I can highly suggest looking into it for inspiration on getting past/around several of the ASP classic "limitations" and for the library of functionality it provides.

夜血缘 2024-08-18 04:28:31

如果您正在寻找一种方法来证明项目的管理合理性,那么找到传统的 ASP 开发人员来继续维护应用程序将变得越来越困难。任何有选择的开发人员可能都不会选择维护使用 VBScript 构建的应用程序。接受这份工作的开发人员可能会认为这是暂时的,并继续寻找其他工作。

虽然我没有收到 Microsoft 的任何消息,但用不了多少年,他们就会决定完全淘汰经典 ASP。

If you are looking for a way to justify the project to management, it will become increasingly more difficult to find classic ASP developers to continue maintaining the application. Any developer that has a choice would probably not choose to maintain an application built using VBScript. Developers that do take the job might consider it temporary and continue to look for other work.

Although I haven't heard anything from Microsoft, it can't be too many years before they decide to retire classic ASP entirely.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文