gpt4 book ai didi

c# - Microsoft.ExceptionMessageBox 不是 "found"

转载 作者:行者123 更新时间:2023-12-02 20:02:46 28 4
gpt4 key购买 nike

我有一个通过 clickOnce 部署的 winform 解决方案。有一个主项目,然后是一个名为 psWinForms 的项目。该项目有一个对我在自定义错误报告中使用的 Microsoft.ExceptionMessageBox 的引用。

我在我的主项目中使用 Copy Local = TruepsWinForms 作为引用。

我有 Microsoft.ExceptionMessageBox 作为 psWinForms 中的引用,Copy Local = False & Specific Version = False

应用程序文件中,我有发布状态=先决条件(自动)

我尝试了各种组合,但没有成功。

我在测试系统上查看了 DLL 是否存在。

C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies

我正在使用 SQL 版本 9.0.242.0 中的 ExceptionMessageBox(如果这有影响)并且用户只安装了 SQL 2005 Express(9.0.1399.0)。

所以我很困惑为什么当我尝试使用这个抛出错误时我的应用程序挂起......

最佳答案

您无法自行复制和部署该程序集,它必须作为 SQL 客户端组件的一部分进行安装。 SQL 2008 和 SQL 2005 有不同的客户端组件,您的应用程序必须引用正确的组件。因此,您必须发布两种不同的应用程序,一种是为 SQL 2005 编译的,另一种是为 SQL 2008 编译的,并且您的用户必须安装正确的应用程序。来自 Deploying an Exception Message Box Application :

The exception message box is installed by Microsoft SQL Server and is supported for use in your custom Windows applications to improve exception handling. Because the exception message box is installed by all editions of SQL Server except SQL Server Compact 3.5 SP1, you can use it with no additional configuration on any computer on which SQL Server client components, including the SDK, have been installed.

虽然从技术上讲可能可以自行部署程序集并将其添加到 GAC 中,但这是一种不好的做法,因为您的 dll 不会成为正常的服务包和累积升级补丁链的一部分。

此外,您最好与 MS 代表弄清楚是否可以使用 SQL 客户端使用许可证独立部署此 dll。每个可以在许可证下重新分发的组件都有一个可供开发人员分发的安装 msi。如果此 dll 不存在,则强烈表明不允许第 3 方(您)重新分发。

更新

实际上,ExceptionMessageBox 组件有一个可分发的 msi(SQLServer2005_EMB.msi、SQLServer2005_EMB_x64.msi):

In SQL Server 2005 SP1 and later releases, the exception message box is also provided as a redistributable installation program that you can distribute and deploy with your application... The redistributable installation program for exception message box is available online as part of the Feature Pack for SQL Server 2005 SP1.

关于c# - Microsoft.ExceptionMessageBox 不是 "found",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1493585/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com