Page 14 - MSDN Magazine, September 2019
P. 14

to production machines. For WinForms, there are new features like better high DPI support. And going forward, new capabilities in .NET, Visual Basic .NET and C# will only be available on .NET Core. In Visual Basic, you’ll get the advantages of Visual Basic 16.0 just by targeting .NET Core 3.0 (netcoreapp2.2).
Cross-Platform Support
Visual Basic .NET on .NET Core is cross-platform, although WinForms, Windows Presentation Foundation and other Windows-specific features will work only on Windows. You can find the OSes that are supported at aka.ms/net-core-3-0-supported-os. If you run a Visual Basic .NET application on an OS like Linux, fea- tures that work cross-platform will just work. If you call Visual Basic Runtime functionality that doesn’t work on that platform, you’ll get a System.PlatformNotSupportedException with a message similar to “<method> not supported on this platform.” This is the same behavior as the rest of .NET, so if you’re working cross-platform, you’ll want to test your application across the OSes where you expect to deploy, regardless of the language you use.
Some project types aren’t supported on .NET Core 3.0. For example, WebForms won’t be supported in any language. Visual Basic isn’t supported by ASP.NET Core Razor, so you can’t simply port MVC applications. And while Microsoft doesn’t offer a Web development model that’s 100 percent Visual Basic, you can use
Changes to Visual Studio and .NET Core Installers
Visual Basic in ASP.NET WebAPI with JavaScript front ends, or create combined apps with views in C# Razor projects.
API Portability Anaylzer
You can test the compatibility of your applications by running the API Portability Analyzer. The tool is available for download as a Visual Studio extension from the Visual Studio gallery or as a command-line tool. Find out more at aka.ms/api-portability. The API Portability Analyzer outputs a spreadsheet listing the percent of your application that will just work in the platforms you select, in this case .NET Core 3.0. Other tabs drill into the specific APIs used in the application, as well as those that aren’t supported.
We Want To Hear from You!
The team wants to understand the issues that face Visual Basic .NET programmers moving to .NET Core and we invite your help on the next stage of that journey. If you run the Portability Analyzer and find you need things missing in the VisualBasic namespace or other Visual Basic-specific issues, let us know by opening an issue, or by commenting on an existing one, at the Visual Basic .NET language design site (github.com/dotnet/vblang).
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 to production machines.
The work we’re doing with .NET Core sets up Visual Basic for the future. Combined with Microsoft’s long-term commitment to .NET Framework 4.8, you have flexibility for both new and legacy applications in Visual Basic, one of the most productive program- ming languages ever created. n
Kathleen DollarD is a principal program manager on the .NET Core team at Microsoft. She is the Program Manager for Visual Basic, contributes to the Managed Languages and works on the .NET Core CLI and SDK.
If you run `dotnet --info` at a command prompt, you’ll see a list of installed .NET Core SDKs and runtimes. There may be a lot more than you anticipated!
Earlier Visual Studio and .NET Core installers haven’t been removing older SDKs and runtimes when they update or uninstall. While you may need these to support SDK pinning via global.json or to target older runtimes, they might just be sitting unused on your machine.
Now, starting with Visual Studio 2019 16.3, Visual Studio will manage the versions of .NET Core SDKs and runtimes it installs. It will only keep one copy of the .NET Core SDK on each machine per channel (preview or release), and will install the latest runtime. You can target earlier runtimes by selecting them—along with their templates and targeting packs—in the Individual Components tab of the Visual Studio Installer.
When you download and install the .NET Core 3.0 SDK from dotnet.microsoft.com/download, earlier patches in the same feature band will now be removed. For example, 3.0.100 will be uninstalled when you install 3.0.102. Previews in that band will also be removed.
Each version of the SDK can target all earlier versions of the run- time, so you generally only need one. If you need additional SDKs or runtimes, you can download them from dotnet.microsoft.com/download.
You can manually remove .NET Core SDKs and runtimes, or you can clean them up using the recently released .NET Core Uninstall Tool on Windows and macOS (aka.ms/remove-sdk-runtime). Just be careful, SDKs aren’t tracked by Visual Studio, so removing the wrong ones can cause issues. If you delete something that Visual Studio needs, run “Repair” in the Visual Studio installer.
10 msdn magazine
First Word


































































































   12   13   14   15   16