Page 12 - MSDN Magazine, September 2019
P. 12

First Word KATHLEEN DOLLARD Visual Basic on .NET Core
I started writing Visual Basic code more than two decades ago, and I understand why so many people still program in Visual Basic .NET. It has almost all of the features of C#, plus unique function- ality that makes it easier for you to focus on what your software accomplishes. This comes from features in the language itself, as well as from language extensions and language stability. Visual Basic also includes unique productivity features like XML literals and in-place event hookup.
Now Visual Basic .NET 16.0 is bringing your favorite Visual Basic features to .NET Core 3.0. The essential parts of the Visual Basic .NET programming language have been on .NET Core since its early development, but developers can expect an enriched experience when Microsoft ships Visual Studio 16.3 and .NET Core 3.0 with Visual Basic 16.0 and C# 8.0 on board.
In my role working on the transition to .NET Core, I was able to dive into the technology behind the language extensions: the special functions, application models and My subsystem.
In my role working on the transition to .NET Core, I was able to dive into the technology behind the language extensions: the special functions, application models and My subsystem. These features are contained in microsoft.visualbasic.dll, also called the Visual Basic Runtime, and many are now included in .NET Core 3.0, except those dependent on Windows Forms (WinForms).
Windows Forms
Visual Basic .NET has a special relationship with WinForms, which was modeled largely on earlier versions of Visual Basic. Among all the options .NET programmers have to build applications, WinForms remains the best at getting the job done fast. In addi- tion to traditional roles, WinForms offers a rapid way to develop thin front ends for services on-premises or in the cloud, either for production or for functional prototypes.
While the WinForms library will be available, the WinForms designers will not be part of Visual Studio 16.3. This limits the experience, so the Visual Basic .NET team decided to focus on the non-WinForms portion of the language extensions for Visual Basic 16.0. This means you can use WinForms on .NET Core with Visual Basic, but you won’t have the project property dialog to enable the Visual Basic Application Model. You’ll need either a Sub Main or a startup form, and you’ll find that the My features aren’t yet available.
Parts of the Visual Basic Runtime depend on WinForms, even for unexpected types like My.Computer. We’re splitting the run- time into the parts that are dependent on WinForms and those that aren’t, with the WinForms-dependent part to appear in a future release of Visual Basic.
Beyond these limitations, Visual Basic .NET 16.0 brings much of the functions of the Visual Basic runtime to .NET Core. This includes key features, like Fix and Mid, that you expect. Telemetry from API Port helped the team prioritize the work here, and some features with very low usage weren’t ported.
Openness and Stability
Visual Basic .NET 16.0 includes the financial and file functions that were ported by folks in the community. Of course, Visual Basic .NET has been open source since 2015. There are significant areas where you can contribute, and many of them aren’t nearly as intimidating as the Roslyn compiler! You can also be part of the revival of Visual Basic .NET communities on Facebook and Gitter. Find more about the community and language design at the Visual Basic .NET language design site (github.com/dotnet/vblang).
For this latest version of Visual Basic, the runtime was ported directly. There were no changes and no effort to “clean up” fea- tures. Things should work the same in .NET Core as they did in .NET Framework. All this is part of the deep commitment to sta- bility within the Visual Basic team. This stability is important for backward compatibility, of course, but the commitment extends to ensuring that code written at different points in the evolution of Visual Basic continues to be easy to read. New features are incorporated slowly in Visual Basic .NET, and only those that feel natural in Visual Basic are added.
Youcandevelopapplicationstargetingeither.NETCoreor.NET Framework (.NET 4.8 and below) with Visual Studio. While .NET Framework will remain supported for a long time, developing applications on .NET Core brings a raft of advantages, including side-by-side and self-contained deployment that eliminates issues that occur when another application’s installation makes changes
8 msdn magazine


































































































   10   11   12   13   14