Convert solution of class libraries in framework to .NET

Dani_S 3,786 Reputation points
2024-11-06T08:53:10.0966667+00:00

Hi,

I have solution with list of clsss libraries in framework 4.6.2.

I would like to know full steps of converting this solution to .NET 8/9 using visual studio.

Thanks in advance,

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,917 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,507 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Lan Huang-MSFT 29,751 Reputation points Microsoft Vendor
    2024-11-07T02:07:33.7033333+00:00

    Hi @Dani_S,

    I think you could try .NET Upgrade Assistant.

    https://learn.microsoft.com/en-us/dotnet/core/porting/#net-upgrade-assistant

    The .NET Upgrade Assistant is a command-line tool that can be run on different kinds of .NET Framework apps. It's designed to assist with upgrading .NET Framework apps to .NET. After running the tool, in most cases the app will require more effort to complete the migration. The tool includes the installation of analyzers that can assist with completing the migration. This tool works on the following types of .NET Framework applications:

    • Windows Forms
    • WPF
    • ASP.NET MVC
    • Console
    • Class libraries

    This tool uses the other tools listed in this article, such as try-convert, and guides the migration process. For more information about the tool, see Overview of the .NET Upgrade Assistant.

    If you are using ASP.NET MVC, you can follow these steps:

    https://learn.microsoft.com/en-us/aspnet/core/migration/mvc?view=aspnetcore-8.0

    Best regards,
    Lan Huang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread

    1 person found this answer helpful.

  2. Bruce (SqlWork.com) 66,621 Reputation points
    2024-11-07T18:12:27.4833333+00:00

    you should do some pre-work. the project should be upgraded to 4.7 or 4.8 before the migration. after migration check all nuget packages have a .netstandard 2.0 or .net core version. if not, you will need a replacement.

    I typically upgrade all libraries to .netstandard 2.0 before migrating the main application to .net core. this keeps the app running, and resolves code and nuget compatibility issues before the main migration. but if you use WCF this will be an issue, as WCF dropped support of .netstandard 2.0.

    if you are using WCF, then you might want to think your strategy going forward. WCF is legacy (though a lot of work is being done to make it work in .net core), and you might want to migrate to a newer technology like gRPC (most similar), Web API / swagger, or Graph API.

    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.