是Microsoft.VisualBasic命名空间"真正的.NET" code? [英] Is the Microsoft.VisualBasic namespace "true .NET" code?

查看:158
本文介绍了是Microsoft.VisualBasic命名空间"真正的.NET" code?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的开发团队正准备启动一个新项目。这家商店一直是VB店,因为VB3的日子,但prevailing现在的观点是,我们是一个.NET店,自C#是为.NET专门创建的,而VB.NET是改造,我们已经决定继续前进,只写C#。周围的Microsoft.VisualBasic命名空间是否有新的发展的一个合法地位问题上的争论围绕或者是只对VB6(及以上)code的向后兼容性。进一步的,更有意思的问题是,code下的Micr​​osoft.VisualBasic命名空间是否是,如果真的是老VB运行库精心包装在.NET包装,使其在甚至.NET code其实COM互操作控制(类似于如何的WinForms包装了non-.NET的Win32 API窗,但消费仅公开。NET的API)。

My dev team is getting ready to start a new project. The shop has been a "VB shop" since the days of VB3, but the prevailing opinion now is that we're a ".NET shop" and since C# was created specifically for .NET, whereas VB.NET was a retrofit, we've decided to move forward writing C# only. The controversy revolves around the question of whether the Microsoft.VisualBasic namespace has a legitimate place in new development or if it is only for backward compatibility for VB6 (and older) code. A further, and more interesting question is whether the code "under" the Microsoft.VisualBasic namespace is even .NET code of if it is really the old VB runtime carefully packaged in a .NET wrapper, making it in fact a COM interop control (similar to how WinForms wraps the non-.NET Win32 windowing API but exposes only .NET APIs for consumption).

为了使这更混乱,我们的开发团队拥有微软咨询服务的顾问告诉我们,微软不再支持Visual Basic中的包括VB运行库的Microsoft.VisualBasic命名空间底层

To make this even more confusing, our dev team has a Microsoft Consulting Services consultant telling us Microsoft no longer supports Visual Basic, including the VB runtime underlying the Microsoft.VisualBasic namespace.

我在寻找什么是链接 - pferably $ P $到无懈可击微软的来源 - 以文档明确回答这个问题的一种方式或其他。我已经尝试了谷歌几个搜索的排列没有得到任何接近获得对这个问题的底部。

What I'm looking for are links -- preferably to unimpeachable Microsoft sources -- to documentation that definitively answers this question one way or the other. I've already tried several search permutations on Google and not gotten any closer to getting to the bottom of this question.

编辑:显然,我没有让我的问题清楚。我不是问的 VB.NET 的是真正的.NET code。我试图确定什么是 Microsoft.VisualBasic命名空间下的是.NET code,或者如果它是旧的VB6运行精心包装,并公开为.NET code。有人说过,命名空间的9/10只是封装code:在.NET其他地方;那么其他的1/10?

Apparently I didn't make my question clear. I'm not asking if VB.NET is true .NET code. I'm trying to determine if whatever is "under" the Microsoft.VisualBasic namespace is .NET code or if it's the old VB6 runtime carefully packaged and exposed as .NET code. Someone already said that 9/10 of the namespace simply wraps code from elsewhere in .NET; what about that other 1/10?

推荐答案

Microsoft.VisualBasic.dll中<> Microsoft.VisualBasic.Compatibility.dll

(或者,如果你preFER, Microsoft.VisualBasic.dll中= Microsoft.VisualBasic.Compatibility.dll;!的)

(or, if you prefer, Microsoft.VisualBasic.dll != Microsoft.VisualBasic.Compatibility.dll; )

Microsoft.VisualBasic.Compatibility 命名空间是专供VB6升级向导的使用,可能会在以后的版本中删除,并且不应该被使用的新的发展。

The Microsoft.VisualBasic.Compatibility namespace is exclusively for use by the VB6 upgrade wizard, may be removed in future versions, and should not ever be used for new development.

Microsoft.VisualBasic程序命名空间是绝对,100%真实的.Net,完全支持,并且将周围只要NET是各地。

The Microsoft.VisualBasic namespace is absolutely, 100% true .Net, fully supported, and will be around as long as .Net is around.

这是一些相关链接:

  • Discussion: Is Microsoft.VisualBasic deprecated?
  • Article: Achieve pure .NET development with VB.NET
  • See comments on this MSDN VBFAQ blog post

编辑:添加从这个MSDN文章

在Visual Basic运行提供   底层实现全球   Visual Basic函数和语言   功能,如LEN,则IsDate和   CStr的。虽然新的Visual Basic   运行时提供了类似的设施   它的predecessors,这是完全   管理code(在Visual开发   基本.NET),关于执行   公共语言运行库。此外,   在Visual Basic运行系统的一部分   .NET框架,所以这是从来没有   一些独立的,你   应用程序必须执行或部署。

The Visual Basic Runtime provides the underlying implementation for global Visual Basic functions and language features such as Len, IsDate, and CStr. And though the new Visual Basic Runtime provides similar facilities as its predecessors, it is entirely managed code (developed in Visual Basic .NET) that executes on the common language runtime. Furthermore, the Visual Basic Runtime is part of the .NET Framework, so it is never something separate that your application has to carry or deploy.

在Visual Basic 6.0的兼容性   库是从Visual不同   基本运行。该   Microsoft.VisualBasic.Compatibility   命名空间所使用的工具,   升级的Visual Basic 6.0 code到   Visual Basic .NET中。这是一个桥梁   支持Visual Basic 6的功能,   不直接支持由.NET   实施的Visual Basic。 与   在Visual Basic运行系统中,   兼容性库不   所有视觉含蓄引用   基本.NET应用程序。当你   升级一个Visual Basic 6项目   Visual Basic .NET中,升级向导   增加了一个参考   Microsoft.VisualBasic.Compatibility。

The Visual Basic 6.0 Compatibility library is distinct from the Visual Basic Runtime. The Microsoft.VisualBasic.Compatibility namespace is used by the tools that upgrade Visual Basic 6.0 code to Visual Basic .NET. It is a bridge to support Visual Basic 6 features that are not directly supported by the .NET implementation of Visual Basic. Unlike the Visual Basic Runtime, the compatibility library is not implicitly referenced by all Visual Basic .NET applications. When you upgrade a Visual Basic 6 project to Visual Basic .NET, the upgrade wizard adds a reference to Microsoft.VisualBasic.Compatibility.

的兼容性类不应该   可用于新的发展。该   Microsoft.VisualBasic.Compatibility   命名空间增加了一层复杂性   到Visual Basic .NET应用程序   并介绍了一些最起码的   性能开销可能是   通过的重新编码的部分消除   应用。此外,该   兼容性命名空间中往往含有   许多类包装COM对象,   并且,如前所述,取决于   COM对象是不是最佳的,因为一个   纯粹的托管实现。

The compatibility classes should not be used for new development. The Microsoft.VisualBasic.Compatibility namespace adds a layer of complexity to your Visual Basic .NET application and introduces some minimal performance costs that could be eliminated by recoding portions of the application. In addition, the Compatibility namespace often contains many classes that wrap COM objects, and as stated earlier, depending on COM objects is not as optimal as a pure managed implementation.

这篇关于是Microsoft.VisualBasic命名空间"真正的.NET" code?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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