Try our conversational search powered by Generative AI!

Powershell 3.0 Required?

Vote:
 

Hi,

I'm trying to setup our deployment process using the Powershell Snappins provided with version 7.5 but I keep getting an error stating 'This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.', when trying to add the snappins.

 

From what I understand this is due to the dll's (i.e. EPiServerInstall.Common.1.dll) being compiled using .net 4.0 and powershell 2.0 not officially supporting this version.  Microsoft recommands installing Powershell version 3.0 in this case.  

Is it intended that Powershell version 3.0 be a requirement when using the EPiSErver Snappins to write a deployment script?

 

#80163
Jan 16, 2014 5:22
Vote:
 

Hello Phil,

PowerShell 3 is not required. If a script is running under the Deployment Center then it will work without any changes, but if you want to use CmdLets in the powershell command line, then you might need to change PowerShells runtime version.

#80193
Jan 16, 2014 13:51
Vote:
 

Yeah I've tried the config and it did work briefly but has since stopped working and I'm not doing the registry hack. 

Microsoft recomends that if you want to use .Net 4.0 with PowerShell that you install powershell 3.0 as these other methods are not strictly supported. https://connect.microsoft.com/PowerShell/feedback/details/525435/net-4-0-assemblies-and-powershell-v2 

I think I'll try with PowerShell 3.0 unless you know of an alternative.

 

#80224
Jan 16, 2014 23:24
Vote:
 

By stating that PowerShell 3.0 is not required I meant that we don't use any functionality specific to PowerShell 3.0, expecpt that our CmdLets are built against .NET 4 runtime.

As far as I know all possible workarounds are already listed in the link that you provided. It should work with the config files changes. If you are using a 64bit OS, then check if the config changes was applied to the proper command line version. There are two places where you can put powershell.exe.config: “c:\Windows\System32\WindowsPowerShell\v1.0\” for 64bit or “c:\Windows\SysWOW64\WindowsPowerShell\v1.0\” for 32bit. EPiServer installer register its CmdLets for 32bit command line, the one that you can start with “Windows PowerShell (x86)” shortcut.

 

#80226
Jan 17, 2014 8:53
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.