An environment variable %DOTNET_ROOT% is required to set to the correct path like C:\Program Files\dotnet
%DOTNET_ROOT%
C:\Program Files\dotnet