使用 Icon.ExtractAssociatedIcon 时出错
我正在尝试加载基于所选文件的图标:
Icon iconForFile = System.Drawing.Icon.ExtractAssociatedIcon(filename);
当我通过 VS 在本地运行此代码时,一切正常。但是,在部署/安装包含此代码的应用程序后,我收到一条错误消息:
“[我的程序] - 无法找到组件: 该应用程序无法启动,因为找不到 libapr_tsvn.dll。重新安装应用程序可能会解决此问题。”
奇怪的是,一旦我单击“确定”,我的程序就会继续按预期运行,并且 Icon
对象已正确设置/显示。搜索表明这可能是是来自 Tortoise SVN 的 dll,我用它来进行版本控制有什么想法吗?
I'm attempting to load an icon based on a selected file:
Icon iconForFile = System.Drawing.Icon.ExtractAssociatedIcon(filename);
When I run this code locally through VS, everything works fine. However, after I deploy/install the application that contains this code, I get an error message:
"[My Program] - Unable to locate Component:
This application has failed to start because libapr_tsvn.dll was not found. Re-installing the application may fix this problem."
Strangely enough, once I click OK, my program continues to run as expected, and the Icon
object is set/displays correctly. Searching around shows that this may be a dll from Tortoise SVN, which I use for version control. Any thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我感觉这与提取图标完全无关 - 您的项目引用了 libapr_tsvn.dll 文件,并且需要删除该引用。
I get the feeling that this has nothing at all to do with extracting icons - your project has the libapr_tsvn.dll file referenced, and this reference needs to be removed.
原来是Tortoise SVN的问题。我前几天更新到最新版本,没有重启,继续工作。
我的应用程序允许用户将文件拖放到列表视图中。当拖放操作发生时,SVN 的钩子似乎会运行;由于 Tortoise 没有正确安装,这个钩子失败并给了我错误消息。再次证明,总是要重启……
Turns out it was a problem with Tortoise SVN. I updated to the latest version a few days ago, didn't restart, and continued working.
My application allows the user to drag-and-drop files into a listview. It appears that a hook for SVN runs when a drap-and-drop action occurs; since Tortoise wasn't properly installed, this hook failed and gave me the error message. Proving once again, always restart...