Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Powershell versions compatibility in .net

Hello guys i'm running powershell in wy asp.net mvc5 application this script works fine on local machine but when hosting the app in a remote server that uses a powershell version earlier than the one in local machine it gives me the following error

Could not load file or assembly 'System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.

I need to know how can i deal with this problem.

like image 453
drex drex Avatar asked Apr 25 '26 12:04

drex drex


1 Answers

System.Management.Automation V3 is not resolved on your remote server.

This could be because you target .Net Framework 4.0 or more in your application and want to deploy it on a computer with Powershell 2.0

You have 2 options:

Downgrade your solution to .Net Framework 3.5

or

Upgrade the Powershell version on your target machine

like image 177
Sébastien Sevrin Avatar answered Apr 28 '26 03:04

Sébastien Sevrin