Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Getting PowerShell to use .NET 4.0 runtime

39 views
Skip to first unread message

Chuck Heatherly

unread,
Apr 21, 2010, 7:19:26 AM4/21/10
to

(Reposted from a Stack Overflow discussion, I just verified that the tip works.)

Once you have installed .NET 4.0 and/or Visual Studio 2010, you may notice that PowerShell and other .NET applications
still use the 2.0 runtime. To make them use the 4.0 runtime, add these values to the registry:

32-bit apps on a 32-bit operating system
64-bit apps on a 64-bit operating system
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework]
"OnlyUseLatestCLR"=dword:00000001

32-bit apps on a 64-bit operating system
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework]
"OnlyUseLatestCLR"=dword:00000001

You do not need to reboot after adding/changing these values. Note that this change affects ALL .NET applications on the
machine. Before the change, opening a PowerShell prompt and executing: [Environment]::Version.ToString() returns
"2.0.50727.4927". After the change, it returns "4.0.30319.1".

Original discussion:
http://stackoverflow.com/questions/2094694/launch-powershell-under-net-4

Marco Shaw [MVP]

unread,
May 8, 2010, 7:13:22 AM5/8/10
to

Thanks for the tip...

Marco

"Chuck Heatherly" <chuck.h...@community.nospam> wrote in message
news:44nts55o82mvu5lp5...@4ax.com...

0 new messages