Share via

How do I change the solution file for .NET 10?

Rod Falanga 871 Reputation points
2026-02-14T16:03:50.9033333+00:00

I've recently upgraded a .NET 9 application to .NET 10. I've set the projects to .NET 10 and the NuGet packages to use .NET 10. But the solution file still has a ".sln" extension. Is the only thing I have to do is rename that file extension to ".slnx" or do I need to do something else?

Developer technologies | ASP.NET | ASP.NET Core
{count} vote

Answer accepted by question author
  1. Bruce (SqlWork.com) 83,421 Reputation points Volunteer Moderator
    2026-02-14T16:54:43.4833333+00:00

    If you want to use the .slnx format, you can just use the migrate tool. You have two options.

    • If using current visual studio, right click solution and pick “save as xml solution (.slnx)”
    • use the dotnet tool
        dotnet sln <solution_name>.sln migrate
      

    note: the migrate tool does not delete the old .sln file. You will need to delete after verifying the new works.

    2 people found this answer helpful.

Answer accepted by question author
  1. Q&A Assist
    2026-02-14T16:03:57.05+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    To change the solution file for .NET 10, you should not just rename the file extension from .sln to .slnx. Instead, you need to create a new solution file in the SLNX format using the dotnet new sln command. This command will generate a new solution file in the SLNX format, which is the default behavior starting from .NET 10.

    If you want to keep the SLN format, you can specify that by using the --format sln option when creating the solution file. Here’s how you can do it:

    1. To create a new SLNX solution file:
         dotnet new sln
      
    2. If you need an SLN-formatted solution file, use:
         dotnet new sln --format sln
      

    Make sure to add your projects to the new solution file afterward using the dotnet sln add command.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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