Make sure that your registry keys:
HKEY_LOCAL_MACHINESOFTWAREMicrosoft.NETFrameworkOnlyUseLatestCLR
and
HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoft.NETFrameworkOnlyUseLatestCLR
are set to 0 (not 1).
This fixed it for me since applications like VS2008 are no longer forced to use .NET 4.0 runtime. I had previously set these registry keys to allow Powershell run inder .NET 4.0, however, a config file should be used for that instead.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…