We have Vista users who cannot run our application -- it crashes on startup. I have isolated the problem to the XamRibbonWindow. I have a sample application that is nothing but a Window which contains a RibbonWindowContentHost, which contains a ribbon with a few empty tabs. This sample application functions correctly. When I change the Window to a XamRibbonWindow, the application will not start up and I receive the following message: Exception has been thrown by the target of the invocation. Nothing of value to me is logged to the event viewer.
To make this more difficult to troubleshoot, it works on some Vista machines and not others, and I'm not able to create a VM that reproduces the problem. I suspect it has to do with the custom window chrome of the XamRibbonWindow, but I don't have clue one for how to fix it.
So, what's broken and how can I fix it?
Its hard to say what is happening but there have been some issues addressed in the xamRibbonWindow recently. I would recommend contacting the support group and requesting the latest hotfix - specifically one that address issue #16346.
I'll add to my thread here while my case is in progress, just in case it jogs anyone's memory. I was able to reproduce the problem on any Vista machine by setting the Theme to Vista Basic. I took it a step further and went to system properties, advanced performance settings to look for the single checkbox I could uncheck to get my sample application working.
By unchecking the "Enable desktop composition" checkbox, I was able to get my application running. This is the desktop window manager. If this is enabled, your screen is rendered first in memory, then from there to the screen. Without this, you don't get the cool transparent window borders.
I consider this a temporary workaround. Actually, I find it hard to believe no one else has encountered this error. With this new information, does anyone know if there's a hotfix that's been released that will let the XamRibbonWindow work with the DWM? If not, how do I submit a bug?
Opening a case helped. Turns out support was able to learn from my sample application that I was using the XamRibbonWindow in a way that was acceptable but not recommended. It is recommended that the XamRibbonWindow's content be set to a XamRibbonWindowContentHost. I had it set to a DockPanel. The XamRibbonWindow accepts any object as its content, but prefers XamRibbonWindowContentHost. That's something I'd recommend be more explicit in future versions. Hope this helps someone else.
Please see my previous reply. I think this is the same issue.