You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

PowerShell7加载GAC中SQL Server IntegrationServices程序集报错求助

PowerShell 7迁移SSIS部署脚本时的程序集加载问题

尝试将用于部署SQL Server Integration Services项目的PowerShell 5脚本迁移到PowerShell 7运行时,遇到全局程序集缓存(GAC)程序集加载失败的问题。

原PowerShell 5可正常运行的代码

[Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.Management.IntegrationServices")

PowerShell 7执行时的报错信息

MethodInvocationException: E:\Work\temp\load-assembly.ps1:6
Line |
6 | [Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.Mana .
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Exception calling "LoadWithPartialName" with "1" argument(s): "Could not load file or assembly
| 'Microsoft.SqlServer.Management.IntegrationServices, Culture=neutral, PublicKeyToken=null'. Operation is not supported.
| (0x80131515)"

已尝试的解决方案

尝试通过指定程序集全名使用Load方法加载,结果与LoadWithPartialName方法一致,仍报错:

$loadStatus = [System.Reflection.Assembly]::Load("Microsoft.SqlServer.Management.IntegrationServices, "+"Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL")

目前不确定该错误是由于Microsoft.SqlServer.Management.IntegrationServices程序集不兼容.NET Core,还是PowerShell Core需要使用不同的程序集加载语法。

内容的提问来源于stack exchange,提问作者sergiom

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.19 09:15:31