XP 中的 C# notificationicon 错误
我有一个 WinForm .NET 2.0 框架应用程序,只要不包含 notificationicon 组件,它就可以在 Vista、Win 7 和 XP 中正常工作。如果我将组件放在表单上并重新编译,Vista 和Win 7运行良好,XP一启动就崩溃。我在 program.cs 中放置了一个记录器来记录它是否成功到达那里,但没有成功。无论我是在 VS2008 还是 VS2010 中编译,都是同样的问题。让同事从她的机器上编译该项目,但错误仅在 XP 中仍然存在。
把notifyicon组件从窗体上去掉,XP中一切都会恢复正常。我尝试在其他 .NET 2.0 项目上放置一个通知图标,它们可以工作,所以我不确定为什么只有这个项目有问题。
在 XP 机器上我尝试了 .NET 2.0 SP0 & .NET 2.0 SP2 仍然存在同样的问题。奇怪的...
I have a WinForm .NET 2.0 framework app that works fine in Vista, Win 7 and XP as long as the notifyicon component is not included. If I drop the component on the Form and recompile, Vista & Win 7 work fine, XP crashes immediately on launch. I put a logger in the program.cs to log if it ever makes it there and it doesn't. Same problem regardless of whether I compile in VS2008 or VS2010. Had coworker compile the project from her machine and bug is still there in XP only.
Take the notifyicon component off the form and everything works again in XP. I tried putting a notifyicon on other .NET 2.0 projects and they work so I'm not sure why just this project has issues.
On the XP machine I tried .NET 2.0 SP0 & .NET 2.0 SP2 with still the same issue. Strange...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我遇到过这样的问题,其中 .ico 文件有问题。
XP 在 ico 中压缩 256x256 图像时存在一些问题。
您可以从NotifyIcon中删除ico并查看崩溃是否仍然发生吗?我们解决这个问题的方法是下载 IcoFx 并解压缩较大的 256x256 图标尺寸。这使得文件明显变大,但解决了我们的问题。
I've had an issue like this where the .ico file was at fault.
XP has some issues with compressed 256x256 images inside an ico.
Can you remove the ico from the NotifyIcon and see if the crash still occurs? The way we fixed it was to download IcoFx and uncompress the larger 256x256 icon size. This made the file significantly larger, but fixed our issue.