views:

126

answers:

3

I'm trying to open the sample Solution for the Microsoft Ribbon for WPF, but I get this error about being unable to load metadata. The solution on that site, and the one linked in the error, is How to: Use an Assembly from the Web in Visual Studio. However, I don't see any 'Unblock' option when I check the Properties dialog for RibbonControlsLibrary.dll in C:\Program Files (x86)\Microsoft Ribbon for WPF\v3.5.40729.1. This may be because when I downloaded the Ribbon stuff, it wasn't the library directly, but rather an installer for the library. How can I get rid of this error so I can actually see the design view of the sample XAML files for the Ribbon WPF?

Here is the full error message:

Unable to load the metadata for assembly 'RibbonWindowSample'. This assembly may have been downloaded from the web. See http://go.microsoft.com/fwlink/?LinkId=179545. The following error was encountered during load: Could not load file or assembly 'RibbonWindowSample' or one of its dependencies. The system cannot find the file specified.

A: 

Did you download a zip file? You need to unblock the zip before unzipping it. Once it's unzipped you won't be able to unblock the individual files that were in it.

alt text

Here's what to look for at the bottom of the properties dialog.

Kate Gregory
It did come from a ZIP file, though I don't see an Unblock option in the Properties of the ZIP file.
Sarah Vessels
A: 

I was seeing the metadata error before building the Solution--it shows up when I first load the Solution. I tried building it just now and it built fine, plus the design view shows the XAML window. I don't know why I see the metadata error when it first loads but it goes away upon building.

Sarah Vessels
@Sarah - see my answer for what might be one reason why it goes away upon building. =)
Rob
+2  A: 

According to the error message, it's not RibbonControlsLibrary.dll that's at fault, it's RibbonWindowSample. Have you unbolocked the solution file and files that form the project? If RibbonWindowSample came pre-compiled, you may need to re-build the solution to generate compiled assemblies that don't have the "web mark" on them.

Rob
I checked the Properties of the Solution and the RibbonWindowSample.csproj file, but neither had Unblock. You were right that rebuilding the Solution got rid of the error, though!
Sarah Vessels
My answer wasn't as clear as it could be.. there's actually two possiblities listed there. Have a look inside the ZIP file, in RibbonWindowSample\bin\Release (or \Debug, whichever is the active configuration). I suspect that there'll be a `RibbonWindowSample.dll`... i.e. the content of the project, pre-compiled. It was that file that had the marker on it and you got rid of it by building and thus re-creating it =) I'll re-phrase my answer shortly so it's clearer for anyone that encounters this in the future.
Rob