Pages

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. 


17 August, 2021

Update .NET Version in SDK and Legacy Project Format Type

As part of Sitecore Upgrade, we had to upgrade .NET version in 100+ Helix projects. The below script was used to update the version in the projects quickly. 

Since Microsoft introduced SDK project format, the XML tag in the project file and also the version format are different. The below updates .NET Target Framework version in both SDK and Legacy Project format types.