我需要在 PowerShell 脚本中使用我的一个 .NET Core 3 组件:
当我尝试添加“System.Private.CoreLib.lib”类型时,出现相同的错误。似乎使用netstandard2.0程序集效果良好,但不适用于我的netcoreapp3.0程序集。我可以采取什么措施才能在PowerShell脚本中使用我的程序集方法?
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脚本中使用我的程序集方法?