Would be better/correct to just put:
die ("Could not find dotnet framework folder. Checked: $checkedLocations");