Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/286.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何使用System.Management.Automation_C#_Powershell_.net Core_Azure Functions - Fatal编程技术网

C# 如何使用System.Management.Automation

C# 如何使用System.Management.Automation,c#,powershell,.net-core,azure-functions,C#,Powershell,.net Core,Azure Functions,我有一个Azure函数,应该触发Powershell脚本。为了使其正常工作,我使用System.Management.Automation包。每次调用函数时,都会出现以下异常: System.IO.FileNotFoundException:'无法加载文件或程序集'System.Management.Automation,版本=6.0.4.0,区域性=中性,PublicKeyToken=31bf3856ad364e35'。系统找不到指定的文件。' 我已经看了掘金包的路径,这似乎是正确的。我还尝试

我有一个Azure函数,应该触发Powershell脚本。为了使其正常工作,我使用System.Management.Automation包。每次调用函数时,都会出现以下异常:

System.IO.FileNotFoundException:'无法加载文件或程序集'System.Management.Automation,版本=6.0.4.0,区域性=中性,PublicKeyToken=31bf3856ad364e35'。系统找不到指定的文件。'

我已经看了掘金包的路径,这似乎是正确的。我还尝试将此代码从类库(.NET标准2.0)移动到函数本身(.NET核心2.1)。 我的同事们以前也没有见过这种情况


在这一点上,我已经研究了一天多了,我仍然不知道我到底做错了什么。有人能帮忙吗?

在我看来,这就像发生的错误之一,因为库对.NET核心运行时的一个非常特定的版本有很深的依赖性(entity framework是另一个只有较新版本才需要等待下面的运行时更新的版本)。我看到这是使用6.0.4-让我看看是否可以重新编程。同时,建议使用Azure函数调用PowerShell脚本PowerShell语言支持(触发另一个函数)