“dynamic operations can only be performed in homogenous appdomain” error while launching PowerShell
问题 I have a powershell script that I am trying to execute from WCF REST service.I am using the System.Management.Automation and System.Management.Automation.Runspaces assemblies. The C# code looks like this: Command command = new Command(path); command.Parameters.Add(param); RunspaceConfiguration runspaceConfiguration = RunspaceConfiguration.Create(); using (Runspace runspace = RunspaceFactory.CreateRunspace(runspaceConfiguration)) { runspace.Open(); ... other code } This error happens here once