SMO 代码支持 sql 2005 和 sql 2008

发布于 2024-08-17 19:52:44 字数 368 浏览 3 评论 0原文

使用 SQL 2008 版本:10.0.0.0 的 SMO 程序集准备了托管的 c# DLL,并且我从非托管的 c++ 代码中调用了该 DLL 中的函数。此应用程序在 SQL Server 2008 中成功运行,但当我在 SQL Server 2005 中运行时,此应用程序抛出异常,如下所示:

描述:无法加载文件或程序集“Microsoft.SqlServer.Smo,版本=10.0.0.0,文化=中性, PublicKeyToken=89845dcd8080cc91' 或其依赖项之一。系统找不到指定的文件。

原因是什么?
sql 2005 失败是否是因为 SMO 版本不正确?
如何使用单个 C# dll 在我的应用程序中支持 sql 2005 和 sql2008?

Prepared a manged c# DLL using assemblies of SMO of version:10.0.0.0 of SQL 2008 and I called the functions in this DLL from an unmanged c++ code. This application is running successfully for SQL Server 2008 but this application is throwing exception when i run for SQL Server 2005 as follows:

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

What would be the reason?
Is it failing in sql 2005 because of the version mismacth of SMO?
How can I give support to sql 2005 and sql2008 in my application using a single C# dll?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

宛菡 2024-08-24 19:52:44

我之前遇到过同样的问题,您是否在安装了 2008 和 2005 的同一台计算机上运行此应用程序?

如果没有,我建议您在运行程序集的计算机/客户端上安装 Sql 2008 的 SMO 库。

此下载将为您提供库

I faced the same issue before, are you running this application from the same machine where you have 2008 and 2005 installed?

If not I suggest you install the SMO libraries for Sql 2008 on the machine/client on which you are running the assembly.

This download will give you the libraries

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文