Sunday, November 15, 2009

RibbonControls and Visual Studio 2010 Beta

When building an WCF project with Visual Studio 2010 that includes Microsoft Office UI's RibbonControls, the project may not build correctly, even though the same project may have been built correctly under Visual Studio 2008. The error is "Operation is not supported. (Exception HRESULT: 0x80131515)".

To fix this problem, first the file "RibbonControlsLibrary.dll" must be unblocked. Right click on this file in Windows Explorer, and then selec "Properties". On the "General" tab, there is an "Unblock" button near the bottem. Click on the button to unblock it.

Second, do no place "RibbonControlsLibrary.dll" in the GAC. If you have already placed it in the GAC, you will get an error saying that "This assembly is not vetted for safe use by partial trust code". Remove it from the GAC by running "gacutil -u RibbonControlsLibrary" from Windows command line. Then add a reference to the file "RibbonControlsLibrary.dll" in your project directly.

This should make your WPF project build under Windows 2010.

2 comments:

  1. This workaround is nice, but unfortunately I've got XP and there is no 'Unblock' button, but error code is exactly the same. Any ideas?

    ReplyDelete
  2. Sorry, I did not see this comment until today, which is two years later :(. I need to find out how to see the comments when I come back to my blog.

    ReplyDelete