使用netcoreapp3.0程序集的PowerShell:添加类型失败,返回“0”;无法加载类型';System.Object';来自组件';System.Private.CoreLib“;

使用netcoreapp3.0程序集的PowerShell:添加类型失败,返回“0”;无法加载类型';System.Object';来自组件';System.Private.CoreLib“;,powershell,Powershell,我需要在powershell脚本中使用我的dotnet core 3程序集之一: try { Add-Type -Path "app.dll" } catch { $_.Exception.LoaderExceptions } 这失败了: Could not load type 'System.Object' from assembly 'System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKe

我需要在powershell脚本中使用我的dotnet core 3程序集之一:

try { 
    Add-Type -Path "app.dll" 
}
catch { 
    $_.Exception.LoaderExceptions 
}
这失败了:

Could not load type 'System.Object' from assembly 'System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' because the parent does 
not exist.
为什么我尝试添加System.Private.CoreLib.lib类型,同样的错误也会发生。 它似乎在netstandard2.0程序集上运行良好,但在我的netcoreapp3.0程序集上运行不好。 要在powershell脚本中使用程序集的方法,我可以做什么