visual-studio 使用 Visual Studio 2010 迁移到 .Net 的 VB6
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1038447/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
VB6 migrating to .Net with Visual Studio 2010
提问by Allan Simonsen
Has anyone migrated a VB6 project to .Net with Visual Studio 2010?
有没有人使用 Visual Studio 2010 将 VB6 项目迁移到 .Net?
I have tested the migration in VS2005, but the resulting .Net code was so messed up, that we decided not to migrate to .Net. So has the VS2010 migration wizard been improved over the wizard in VS2005 or VS2008?
我已经在 VS2005 中测试了迁移,但是生成的 .Net 代码非常混乱,我们决定不迁移到 .Net。那么VS2010的迁移向导是否比VS2005或VS2008中的向导有所改进呢?
采纳答案by Simon P Stevens
It certainly hasn't in 2008 and I'd be very surprised if it's any different in 2010.
2008 年肯定没有,如果 2010 年有任何不同,我会感到非常惊讶。
VB6 and VB.net are totally different languages, and MS has never officially endorsed an automatic migration route for anything beyond simple applications. The migration path is non-trivial. There are several companies around that offer migration services, I haven't tried them but my advice would be manage it yourself.
VB6 和 VB.net 是完全不同的语言,MS 从来没有正式认可过简单应用程序以外的任何东西的自动迁移路线。迁移路径非常重要。周围有几家公司提供迁移服务,我还没有尝试过,但我的建议是自己管理。
We currently have several apps that are written largely in VB6. Our position is that existing working code is not migrated to .net without a good reason, but all new code must be written in .net (We've actually chosen C#)
我们目前有几个主要用 VB6 编写的应用程序。我们的立场是,现有的工作代码不会无缘无故地迁移到 .net,但所有新代码都必须用 .net 编写(我们实际上选择了 C#)
What this means is that if we want to add a new feature to an existing VB6 app the feature must be implemented in .net with some interop. Gradually over time are apps are becoming more and more .net and less and less VB. We have 1 app that just has a tiny VB6 component now and the rest is almost entirely in .net thanks to this gradual migration approach. It has worked very well for us. Once we reach a stage where the VB6 portion is minimal, we simply manually convert the remaining code without high cost because there is only a tiny bit left.
这意味着如果我们想向现有的 VB6 应用程序添加新功能,则该功能必须在 .net 中通过一些互操作来实现。随着时间的推移,应用程序越来越多地使用 .net,而使用 VB 的却越来越少。我们有 1 个应用程序,现在只有一个很小的 VB6 组件,由于这种渐进式迁移方法,其余的几乎完全在 .net 中。它对我们非常有效。一旦我们达到 VB6 部分最少的阶段,我们只需手动转换剩余的代码,成本就不会很高,因为只剩下一点点。
回答by Kev
As many have pointed out, I very much doubt there will have been much more work done on the VB6 upgrade wizard. The VB6 upgrade wizard in Visual Studio is actually a cut down version of ArtinSoft's Visual Basic Upgrade Companion.
正如许多人指出的那样,我非常怀疑在 VB6 升级向导上是否会有更多的工作要做。Visual Studio 中的 VB6 升级向导实际上是 ArtinSoft 的Visual Basic Upgrade Companion 的精简版。
Upgrading a non-trivial VB6 application is a fairly time consuming task but there are a number of great articles such as this one that can help smooth out the road for you:
升级一个重要的 VB6 应用程序是一项相当耗时的任务,但有很多很棒的文章,例如这篇文章,可以帮助您铺平道路:
A combination of good methodology and professional tools such as those by ArtinSoft and Code Architectswill hopefully make for a successful result.
良好的方法论和专业工具(例如 ArtinSoft 和Code Architects 的工具)的结合有望取得成功。
回答by dsluis
回答by Patrick McDonald
I would seriously doubt it, VB10 has not introduced any features from VB6 that were not present in VB7, 8 or 9, so there would be no new reasons for them to update their (arguably inadequate) upgrade wizard that did not exist in 2005.
我会严重怀疑,VB10 没有从 VB6 引入任何在 VB7、8 或 9 中不存在的功能,所以他们不会有新的理由来更新 2005 年不存在的(可以说是不充分的)升级向导。
回答by Justin Niessner
Since VS2010 is still in Beta, it's hard to say how the final product is going to perform. Right now, it looks like the Migration code is still a little rocky.
由于 VS2010 仍处于 Beta 阶段,因此很难说最终产品的性能如何。现在,看起来迁移代码仍然有点不稳定。
I'm going out on a limb and saying that VS2010 isn't going to be any better at importing something as old as a VB6 project than previous versions. Chances are, no matter what happens, you're going to have to re-write a significant portion of that application to get any benefit out of .NET anyway.
我要冒昧地说 VS2010 在导入像 VB6 项目一样古老的东西方面不会比以前的版本更好。有可能,无论发生什么,您都必须重新编写该应用程序的重要部分,才能从 .NET 中获得任何好处。
回答by Rad
Visual Studio conversion of VB 6 is spotty at best, due to some of the fundamental language changes. You might find better success looking at a third party tool like VBMigration Partner
由于一些基本的语言变化,VB 6 的 Visual Studio 转换充其量是参差不齐的。您可能会发现查看像VBMigration Partner这样的第三方工具会取得更大的成功

