Migration, Modernization and VB/C# Interoperability

49.1 .NET Framework → .NET 8+

Assess: .NET Upgrade Assistant (VS extension/CLI) and API portability analysis.

Convert projects to SDK-style. Move to PackageReference.

Retarget libraries to netstandard2.0 (shared) or multi-target (<TargetFrameworks>net48;net8.0</TargetFrameworks>).

Replace unsupported tech:

WCF server → CoreWCF or gRPC/REST Remoting → gRPC/pipes AppDomains → AssemblyLoadContext/processes

Web Forms → Blazor/Razor (C#) or a JS SPA System.Web dependencies → ASP.NET Core

ConfigurationManager → Microsoft.Extensions.Configuration (or the compatibility package) Test thoroughly. Deploy side by side.

WinForms/WPF apps migrate well. The designer has improved on .NET, though third-party controls need .NET-compatible versions.

49.2 VB6 → VB.NET

Tools: Mobilize.Net VBUC, VB Migration Partner. Or a rewrite with incremental COM interop (expose .NET components to VB6).

Key differences: integer sizes, Variant → Object, Set removal, default properties, 0-based arrays, On Error → Try...Catch, control arrays, ByRef default → ByVal default.

49.3 VB.NET ↔ C# Interop

Mixed-language solutions: separate projects that reference each other freely (same IL).

Code conversion: ICSharpCode CodeConverter (VS extension, CLI, web), useful for learning C# samples or migrating gradually.

Keep public APIs CLS-compliant (<Assembly: CLSCompliant(True)>).

Avoid identifiers that differ only by case (VB is case-insensitive!).

Avoid C#-only constructs in shared APIs (ref structs, static abstract members) if VB must consume them.

Strategy: VB for existing domain/business code and WinForms, C# for new UI tech (Blazor, MAUI) and source-generator-dependent libraries.

49.4 The Future of VB.NET

Microsoft's strategy: VB is supported on .NET for its existing workloads, focused on stability, with no new major language features and no expansion to new workloads. VB 16.9 is the current language version. Each new .NET release keeps VB working and consumes key runtime features where feasible.

Check the .NET blog and docs for each release's VB status.