C# notifyicon bug in XP
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 h开发者_开发知识库er 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...
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.
精彩评论