Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

So, the story is the following:

I just joined a team of an existing sharepoint project, sharepoint is installed RTM on all environments, from DEV to production.

But because its 2 companies working for the same project, Me as a member of the 2nd company, my VM has .net framework 4.0 already installed.

So I was in charge of making some changes adding fields, features, etc.

And when I was going to use Enable-SP Feature I had this exception: I have 2 options so far:

  1. Install SP1, and the June CU in all environments. http://support.microsoft.com/kb/2536599

  2. Uninstall .net 4 from my environment.

  3. Here comes, the question, is there another way to solve it?

Update1: by checking the logs I found more info:

A PlatformNotSupportedException occured while trying to acquire the local farm: System.PlatformNotSupportedException: Microsoft SharePoint is not supported with version 4.0.30319.225 of the Microsoft .Net Runtime. at Microsoft.SharePoint.Administration.SPConfigurationDatabase.get_Farm() at Microsoft.SharePoint.Administration.SPFarm.FindLocal(SPFarm& farm, Boolean& isJoined)

share|improve this question
1  
I checked and all the projects inside the solution are .net 3.5 –  L.V. Sharepoint Architect Jul 11 '12 at 13:15
    
i have the same error but not using powergui –  user10590 Sep 7 '12 at 12:50

2 Answers 2

up vote 1 down vote accepted

Since this is a PowerGUI issue, you can fix it by following this solution. Follow these steps.

  1. Open your windows explorer and navigate to C:\Program Files (x86)\PowerGUI\ and open the configuration file ScriptEditor.exe.config.

  2. Change the supportedRuntime version under Startup settings by removing the version=”v4.0″ as below

Final <Startup> element

    <startup useLegacyV2RuntimeActivationPolicy="true">
           <supportedRuntime version="v2.0.50727" />
    </startup>

Now you can enjoy the powerful editor again.

If you check the startup settings and the version is v2.0.50727, try closing PowerGUI and reopening.

share|improve this answer
    
I don't use PowerGUI. I have this error in PowerShell command like this Restore-SPSite server_name/sites/site_name -Path C:\Backup\site_name.bak, what i must do? PS Sorry for my bed English, i'm a Russian :( –  user13317 Nov 29 '12 at 21:09

I partially found the error.

POWERGUI tool is the guilty one, when I run the upgrade spsolution and install sp feature in the normal powershell window it works. In powerGUI it does not work.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.