WCF REST サービスから実行しようとしている powershell スクリプトがあります。アセンブリSystem.Management.Automation
とSystem.Management.Automation.Runspaces
アセンブリを使用しています。
C# コードは次のようになります。
Command command = new Command(path);
command.Parameters.Add(param);
RunspaceConfiguration runspaceConfiguration = RunspaceConfiguration.Create();
using (Runspace runspace = RunspaceFactory.CreateRunspace(runspaceConfiguration))
{
runspace.Open();
... other code
}
open ステートメントを実行しようとすると、このエラーが発生します。
動的操作は同種の AppDomain でのみ実行できます。
私は見て見ましたが、何も機能しませんでした。この行を web.config に追加しようとしましたが、何もしませんでした。
考えはありますか?