应用程序在 SQL 2008 计算机上找不到 Microsoft.SQLServer.SMO

发布于 2024-07-26 01:35:59 字数 1352 浏览 3 评论 0原文

我有使用 Microsoft.SqlServer.Management.Smo 的代码。 (内置于 Visual Studio 2005 SP1) 它在 SQL 2000 和 SQL 2000 上运行良好。 SQL 2005 机器。 但是当它在 SQL 2008 计算机上运行时,它会抛出异常:

System.IO.FileNotFoundException:无法加载文件或程序集 'Microsoft.SqlServer.Smo,Version=9.0.242.0,Culture=neutral,PublicKeyToken=89845dcd8080cc91' 或其中之一它的依赖项。 该系统找不到指定的文件。 文件名:'Microsoft.SqlServer.Smo,版本=9.0.242.0,文化=中性,PublicKeyToken=89845dcd8080cc91'

=== 日志:此绑定在默认加载上下文中启动。 日志:找不到应用程序配置文件。 日志:使用 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config 中的计算机配置文件。 日志:策略后参考:Microsoft.SqlServer.Smo,版本=9.0.242.0,文化=中性,PublicKeyToken=89845dcd8080cc91 日志:尝试下载新的 URL 文件:///C:/Documents and Settings/Automation/Desktop/Debug/Microsoft.SqlServer.Smo.DLL。 日志:尝试下载新的 URL 文件:///C:/Documents and Settings/Automation/Desktop/Debug/Microsoft.SqlServer.Smo/Microsoft.SqlServer.Smo.DLL。 日志:尝试下载新的 URL 文件:///C:/Documents and Settings/Automation/Desktop/Debug/Microsoft.SqlServer.Smo.EXE。 日志:尝试下载新的 URL 文件:///C:/Documents and Settings/Automation/Desktop/Debug/Microsoft.SqlServer.Smo/Microsoft.SqlServer.Smo.EXE。

我已经安装了 SQL 2005 向后兼容包(针对 SQL 2008 进行了更新)& SQL 管理对象(针对 SQL 2008 更新)

任何建议。

我经历了 SQL Server SMO 抱怨缺少 DLL 但没有太多一个帮助。

I have code that uses Microsoft.SqlServer.Management.Smo. (Built in Visual Studio 2005 SP1)
It works fine on SQL 2000 & SQL 2005 machine.
But when it is run on SQL 2008 machine it throws an exception:

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.SqlServer.Smo, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.SqlServer.Smo, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'

===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: Microsoft.SqlServer.Smo, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91
LOG: Attempting download of new URL file:///C:/Documents and Settings/Automation/Desktop/Debug/Microsoft.SqlServer.Smo.DLL.
LOG: Attempting download of new URL file:///C:/Documents and Settings/Automation/Desktop/Debug/Microsoft.SqlServer.Smo/Microsoft.SqlServer.Smo.DLL.
LOG: Attempting download of new URL file:///C:/Documents and Settings/Automation/Desktop/Debug/Microsoft.SqlServer.Smo.EXE.
LOG: Attempting download of new URL file:///C:/Documents and Settings/Automation/Desktop/Debug/Microsoft.SqlServer.Smo/Microsoft.SqlServer.Smo.EXE.

I have installed SQL 2005 Backwards compatibility pack (updated for SQL 2008) & SQL management Objects(Updated for SQL 2008)

Any suggestions.

i went through SQL Server SMO complains of missing DLL but not much of a help.

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

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

发布评论

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

评论(3

じ违心 2024-08-02 01:35:59

我发现了这个问题。 我正在参考 SQL 2005 SDK DLL 来构建该项目。 我删除了所有参考文献和 再次添加引用(现在指向 SQL 2008 dll 查看帖子:http:// msdn.microsoft.com/en-us/library/ms162129.aspx)获取要添加的引用列表。
此外,目标计算机需要具有 Microsoft SQL Server 2005 向后兼容性组件和组件。 Microsoft SQL Server 2008 管理对象和数据库 安装了 SQL Server 系统 CLR 类型 (2008)。

I found the issue. I was building the project with references to SQL 2005 SDK DLLs. I removed all the references & added the references again (now pointing to SQL 2008 dlls view post: http://msdn.microsoft.com/en-us/library/ms162129.aspx) for list of references to add.
Additionally, the target machine needs to have Microsoft SQL Server 2005 Backward Compatibility Components & Microsoft SQL Server 2008 Management Objects & SQL Server System CLR Types (2008) installed.

深海夜未眠 2024-08-02 01:35:59

查看 Microsoft SQL Server 2008 功能包,2009 年 4 月(确保您已安装 SQL Server 2008 Service Pack 1)

Take a look at the "Microsoft SQL Server 2008 Management Objects" section of Microsoft SQL Server 2008 Feature Pack, April 2009 (make sure you have SQL Server 2008 Service Pack 1 installed)

坏尐絯℡ 2024-08-02 01:35:59

不确定这个问题是否已解决,但听起来原始发布者已将 dll 的“特定版本”属性设置为“True”。

要解决此问题,请在引用文件夹中选择引用并将“特定版本”属性设置为 true。

微软确实将一些功能转移到了 Microsoft.SMO.Extended,但这是一个单独的问题

Not sure if this was resolved, but it sounds like the original poster had the "Specific Version" property set to "True" for the dll.

To fix this, select the reference in the References folder and set the "Specific Version" property to true.

Microsoft did move some functionality to Microsoft.SMO.Extended, but that's a separate issue

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