无法加载文件或程序集'Microsoft.SqlServer.BatchParser

时间:2015-06-05 14:34:56

标签: c# .net sql-server

目前,我们已将Web应用程序迁移到新服务器,因此现在我们拥有了数据库和Web + App Server。移动之前一切正常。

但是现在我们在数据库服务器上安装了SQL Server,我们遇到了与以下内容相关的错误:

Microsoft.SqlServer DLL文件。

所以基本上代码在数据库服务器上运行一个脚本来创建一个新数据库。

首先我收到错误,与Microsoft.SqlServer.ConnectionInfo.dll

有关

所以我安装了nuget包:Shared Management Objects

enter image description here

这似乎解决了这个问题。

但现在我收到与Microsoft.SqlServer.BatchParser

相关的错误

我按照在线链接,他们建议安装:

共享管理对象从这里开始; https://www.microsoft.com/en-pk/download/confirmation.aspx?id=29065

  

请注意;我们使用的是SQL Server 2012标准。

所以我安装了Shared Management Objects并重新启动了服务器,但我仍然遇到同样的错误。

Could not load file or assembly 'Microsoft.SqlServer.BatchParser, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.

如果我导航到:C:\ Windows \ assembly我可以看到Microsoft.SqlServer.BatchParser

enter image description here

此行代码发生异常:

server.ConnectionContext.ExecuteNonQuery(script);

0 个答案:

没有答案