Upgrading Your .NET API: A Journey into the Future of .NET

Ibrahim Jaber
3 min readNov 29, 2023

Today, we embark on a thrilling adventure into the heart of software development — upgrading a .NET API application to a newer, shinier version of the .NET framework.

The Quest Begins: Identify Your Current .NET Version

Our first task is to discover the current version of .NET that powers your API project. Open up that .csproj file and seek out the mystical <TargetFramework> tag. It's like reading the map to a hidden treasure, guiding you to the very soul of your project.

Choose Your Destiny: Research the Target .NET Version

Now, let’s don our explorer hats and venture into the realm of possibilities. Research and decide which version of .NET you want to upgrade to. Check out the wonders that await you in the official .NET 6 documentation.

Navigate the Unknown: Review Compatibility and Breaking Changes

As we set sail into uncharted waters, arm yourself with knowledge. Dive into the official documentation and release notes for your chosen .NET version. Look out for any lurking sea monsters — compatibility issues or breaking changes. Preparation is the key to a smooth voyage!

Compatibility and Breaking Changes

Hoist the Colors: Update Project Target Framework

Time to set your flag on the new land! Update your project’s target framework to the chosen .NET version. This can be done in the project properties or the project file. Save your changes and revel in the victorious build of your upgraded project.

Restore the Magic: After Target Framework Change

But beware! After changing the target framework, don’t forget to restore and build your project. Use the commands dotnet restore and dotnet build to ensure everything is shipshape.

Update the Scrolls: Update .yml Pipelines

To avoid the curse of build errors, update the @useDotNet task in your project's YAML pipeline files. Let the build pipelines sing in harmony with your upgraded framework.

Refresh the Elixir: Update NuGet Packages

--

--

Ibrahim Jaber

Software developer | Programming and Blockchain enthusiast | If you'd like to buy me coffee: https://ko-fi.com/ibrahimjaber