Winform .Net 3.5 - 获取 Office 加载项的 ApplicationFolder 路径
我正在 VS2008 中为 Expression Web 3 编写一个加载项
该解决方案有一个 Windows Installer 安装项目,其中 ApplicationFolder 被标记为保存一些辅助文件。
我需要能够在加载项启动期间访问这些文件,但自然是 Application 对象以及 AppDomain 引用路径到 Expression Web 而不是加载项。
我的后脑勺有些痒痒,解决方案涉及反思,但据我所知......有人处理过这个问题或有任何建议吗?
I am writing an add-in for Expression Web 3 in VS2008
The solution has a Windows Installer setup project in which the ApplicationFolder is tagged to hold some ancillary files.
I need to be able to access those files during the add-in's startup, but naturally the Application object as well as the AppDomain reference paths to Expression Web not to the Add-In.
There is a tickle in the back of my head that the solution involves reflection but thats as far as I can get... has anyone dealt with this or have any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您的插件程序集与您想要访问的文件位于同一位置,您可以尝试:
然后您可以从
containingFolder
中获取您想要的任何文件。If your addin's assembly is in the same place as the files you want to get to, you could try:
You could then get at whatever files you want from
containingFolder
.