batchparser 无法加载_找不到microsoft.sqlserver.batchparser.dll

博客作者在本地开发了一个使用SQL Server 2008 SMO(SQL Server Management Objects)运行DB脚本的ASP.NET Web应用。应用引用了特定版本的SQL Server SDK组件。当尝试将应用部署到远程32位的discountasp.net托管服务时,出现找不到Microsoft.SqlServer.BatchParser.dll文件的错误。解决方案是安装Microsoft SQL Server 2008 Management Objects或手动部署缺失的DLL,但可能涉及许可问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

I wrote an asp.net web app which uses SMO against SQL Server 2008 to be able to run some DB scripts. It references these assemblies (in the C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies folder):

Microsoft.SqlServer.ConnectionInfo

Microsoft.SqlServer.Management.Sdk.Sfc

Microsoft.SqlServer.Smo

The microsoft.sqlserver.batchparser.dll is not in this folder.

Locally (32 bits machine, IIS7) I have no issue.

When I publish the app to my hosting provider (discountasp.net, SQL Server 2008, IIS7, 32bits too), I get this error:

Could not load file or assembly

'Microsoft.SqlServer.BatchParser,

Version=10.0.0.0, Culture=neutral,

PublicKeyToken=89845dcd8080cc91' or

one of its dependencies. The system

cannot find the file specified.

I searched my local machine and I can't find this assembly. However it works well on this machine.

The "Microsoft SQL Server 2008 Setup Discovery Report" tool reports I have v10.1.2531.0 installed locally.

Thanks

解决方案

To get this dll, you will need to install the Microsoft SQL Server 2008 Management Objects (available from here). That particular dll gets installed into the GAC, which is why you probably cannot find it using a search.

As you are using a hosting provider, it would appear that they do not have this installed. Your choices are to get it installed by them (which is probably unlikely), or deploy the dll manually (which may be on dodgy licencing ground).

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值