18 August, 2021

Sitecore Upgrade - Codebase Upgrade Series - Framework upgrade - .NET

As part of the Sitecore codebase upgrade series, in this blog, we are going to deal with upgrading .NET Framework version. 

Option 1: Using PowerShell, we can quickly update the version in all the csproj files. The script has been added in this blog. This script will update both legacy and SDK project format.

Option 2: To upgrade .NET framework, you can open the csproj files in Notepad++ and replace the version number from 4.x to 4.8 (or desired version as per Sitecore). 

  • SDK Style Projects
    Should replace <TargetFramework>net4xx</TargetFramework> with the targeted version. 
  • Legacy Style Projects
    Should replace <TargetFrameworkVersion>v4.x.x</TargetFrameworkVersion> with the targeted version. 

Option 3: There is a Visual Studio marketplace module called TargetFrameworkMigrator. Once you install it, you can change the target framework to the desired version. This will work only for the Legacy Style Projects. SDK Style Project support will be added in the next version as per the roadmap. 

  • Once you install the VS Extension. Open the extension from Tools menu --> Target Framework Migrator.
  • Choose the projects you want to migrate, then click Migrate. 

No comments:

Post a Comment

blockquote { margin: 0; } blockquote p { padding: 15px; background: #eee; border-radius: 5px; } blockquote p::before { content: '\201C'; } blockquote p::after { content: '\201D'; }