Migrating VB.Net (.vbProj) Project into .Net 5

MRUTYUNJAYA MAHAPATRA 1 Reputation point
2021-04-15T09:30:49.063+00:00

Hi, I am migrating one vb.net project into .Net 5. Can anybody please suggest How can I migrate Vb.net projects into .Net 5.

Best Regards
Mrutyunjaya

Developer technologies Windows Forms
Developer technologies Windows Presentation Foundation
Developer technologies VB
Developer technologies C#
{count} votes

2 answers

Sort by: Most helpful
  1. Elmar 26 Reputation points
    2021-04-15T10:52:28.46+00:00

    You could try this tool try-convert. Its sole purpose is to help in migrating .NET Framework projects to .NET Core. I gave it a try and it worked - more or less. I had to cleanup a lot afterwards. So, it is not like waving the magic wand and voila!

    I noticed it is much cleaner to do it by yourself. Just creating a new .NET5 project and copying your .NET Framework files one-by-one into the new project. Then you have to get rid of all the red underlines by adding the appropriate NuGet packages to your project to make the references work again.

    So, that tool is ok, if you don't want to dirty your hands. But, doing it by yourself is much cleaner.

    0 comments No comments

  2. Karen Payne MVP 35,586 Reputation points Volunteer Moderator
    2021-04-15T12:29:33.733+00:00

    I'd recommend

    • Using the migration tool as a way to see what it takes to migrate to .net5 only. See example here. One of the biggest challenges are references e.g. if using sql-server database the provider needs to be installed via a NuGet package. Then in some cases there are no replacements for items or not fully implemented.
    • Then create a new .net core project rather then even thinking about basing code on .net framework classic.
    • Double click the new project project name in solution explorer and replace content with below or via the project property window.
    • When adding NuGet packages if you get what is shown in figure 1 the package is not compatible with .net5
    • Create a private GitHub repository for source control which also provides the ability to revert changes if needed.

    You can also create a empty windows form project then use export template so that in the future you don't need to repeat all the setup needed to use .NET5.

    Project file

    <Project Sdk="Microsoft.NET.Sdk">  
      
      <PropertyGroup>  
        <RootNamespace>DateTimeLibary</RootNamespace>  
        <TargetFramework>net5.0</TargetFramework>  
      </PropertyGroup>  
      
    </Project>  
      
    

    Figure 1

    88242-f1.png

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.