Could not load type StringTools.FowlerNollVo1aHash

Recently, I downgraded my Visual Studio 2022 Enterprise installation to Visual Studio 2022 Professional, which worked well, except that I couldn’t compile anything with CMake and couldn’t open most C# projects, as MSBuild was failing with the following cryptic error message:

Project.csproj : error : The expression "[MSBuild]::StableStringHash(Project.csproj)" cannot be evaluated. Could not load type 'Microsoft.NET.StringTools.FowlerNollVo1aHash' from assembly 'Microsoft.NET.StringTools, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets

Web searches quickly lead me to some Developer Community posts that mostly said, that this issue has been fixed and one just needed to install the latest VS version, which of course I already had.

Alternatively, they mention to uninstall one assembly from the GAC (Global Assembly Cache). Unfortunately, the provided command fails, as the assembly is listed as still being used by Windows Installer.

After searching a bit more, I came across yet another Developer Community post, that did describe an extra step, where the mentioned assembly reference is manually removed from the Windows Installer, after which the GAC uninstall command actually works.

So far I haven’t noticed any issues with the Windows Installer.

The Fix

  1. Delete the registry key for Microsoft.NET.StringTools at: HKEY_LOCAL_MACHINE\Software\Classes\Installer\Assemblies\Global
  2. Run the Developer Command Prompt as admin
  3. Execute the following command: gacutil /u "Microsoft.NET.StringTools, Version=1.0.0.0"
  4. Start Visual Studio

Leave a Comment

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.