C# com对象配置最佳实践
我必须为依赖 com 对象的遗留应用程序开发扩展。
我的扩展通过 MSVS 实现为 com-server-in-dll (.net 程序集),并安装在 [program files][company] 文件夹中(作为 msi 文件分发)。
配置它的最佳实践是什么:将 app.config 放入安装文件夹(我怀疑上传它会造成一些混乱,因为主机进程根本没有 app.config)或保留过去的做法来处理系统注册表?
您个人更喜欢什么?
I have to develop extension for legacy application that relies on com objects.
My extension is implemented as com-server-in-dll (.net assembly) with MSVS and installed in [program files][company] folder (distributed as msi file).
What is the best practice to configure that: put app.config to installation folder (i suspect there would be some mess to upload that as host process has no app.config at all) or keep old days practice to deal with system registry?
What would you personally prefer?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于您的应用程序由使用注册表样式配置的“旧版”应用程序托管,因此我会坚持这样做。
特别是,弄清楚将
app.config
放在哪里可能会让您(作为开发人员)和您的用户感到困惑。更糟糕的是,这与未来维护该应用程序的其他人所期望的方式不同。As your application is hosted by a "legacy" application that uses registry-style configuration, I'd stick with that.
In particular, figuring out where to put an
app.config
might get confusing to you (as a developer) and your users. Worse, this is a different way from what anyone else coming to maintain the application in future would expect.