vb.net.net-core

How to convert a VB.Net project to .NetCore


How to convert my vb.net project into .NetCore .

I have used .NET Portability Analyzer extension from the Visual Studio Marketplace and it shows most of the solutions have more than 90% portability.

.NetCore supports VB and I assume no code change is required for conversion. But I didn't get any option to convert my vb project to .NetCore .My project is in .Net Framework 4.5 . Do I need to convert to latest .Net Framework before conversion? Is there any visual studio plugins available for conversion (to .net framework and then to .Net Core)?

Thanks in advance .


Solution

  • I would recommend updating your project file (.vbproj) to the new format. Here is an example of a netstandard2.0 project file:

    <Project Sdk="Microsoft.NET.Sdk">
    
      <PropertyGroup>
        <RootNamespace>VbTest</RootNamespace>
        <TargetFramework>netstandard2.0</TargetFramework>
      </PropertyGroup>
    
      <ItemGroup>
        <PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
      </ItemGroup>
    
      <ItemGroup>
        <ProjectReference Include="..\ClassLibrary1\ClassLibrary1.vbproj" />
      </ItemGroup>
    
    </Project>
    

    I've typically done this as a manual process when upgrading c# projects.

    Easy parts:

    Harder parts: