VB.NET 在编译时忽略错误引用
我遇到了一个问题,该程序引用了我被拒绝分发的第三方 ActiveX 组件。
AX 组件用于一些用户定义的控件,用户可以通过编程方式添加这些控件,这使得隔离它们相当容易。
然而,问题是,如果该程序安装在没有第三方组件的计算机上,那么它就会崩溃,我更希望它只是提醒用户缺少组件,然后禁用需要该组件的功能。
过去,我尝试以编程方式添加引用,但发现此解决方案不适用于此特定控件。
任何有关允许程序在缺少引用组件的情况下运行的策略的建议将不胜感激。
I've got a problem with a program that references a third party ActiveX component that I've been refused permission to distribute.
The AX component is used on some user defined controls which the user can add programatically, which makes isolating them fairly easy.
However, the problem is that if the program is installed on a machine without the third party component then it just crashes, where I would much prefer it to just alert the user to the missing component and then disable the functionality that requires the component.
In the past I've tried adding the reference programatically but have found that this solution doesn't work with this particular control.
Any suggestions as to a strategy that allows the program to run despite missing referenced components would be much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您使用启动器应用程序。部署这两个应用程序。您向用户显示的快捷方式应该启动您的启动器应用程序。启动器将首先检查所有依赖项是否都已到位,如果是,则继续启动您的应用程序。否则,它将向用户显示更好的错误消息,并可能向他们指出可以在哪里找到丢失的依赖项。
You use a launcher app. Deploy both apps. The shortcut you show to the user should start your launcher app. The launcher will first check that all the dependencies are in place, and if so go on to start your app. Otherwise, it will show the user a nicer error message, and perhaps point them to where they can find the missing dependency.