PowerGUI stops working with SharePoint after installing .Net 4.0.

Problem

You try to run a script that uses SharePoint cmdlets in PowerGUI and it throws up the following error:

Microsoft SharePoint is not supported with version 4.0.30319.261 of the Microsoft .Net Runtime

Solution

Browse to your PowerGUI root directory, e.g. C:\Program Files (x86)\PowerGUI.

Look for the file ScriptEditor.exe.config

Make a backup copy of it and modify the original.

Change it from:

<configuration>

<startup useLegacyV2RuntimeActivationPolicy=”true”>

<supportedRuntime version=”v4.0″ sku=”.NETFramework,Version=v4.0″ />

<supportedRuntime version=”v2.0.50727″ />

</startup>

to this

<configuration>

<startup useLegacyV2RuntimeActivationPolicy=”true”>

<supportedRuntime version=”v2.0.50727″ />

</startup>

 

Tags:

No comments yet.

Leave a Reply

%d bloggers like this: