Strange Ribbon error in Visual Studio when building-Collection of common programming errors

I’m receiving a strange error in Visual Studio when building my WPF application with .NET 4.5 in Visual Studio 11.

My WPF XAML markup is as follows:


    
        
            
            
        
        
            
                
                
            
            
                
                    
                        
                            
                                
                                    
                                    
                                    
                                    
                                    
                                
                            
                        
                    
                    
                        
                        
                        
                    
                
            
            
            
        
        

        
    

Now, when I build, I receive the error:

Unknown build error, ‘Method ‘get_Command’ in type ‘System.Windows.Controls.Ribbon.RibbonGallery’ from assembly ‘System.Windows.Controls.Ribbon, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’ does not have an implementation.

When I remove the RibbonGallery element from the code, it compiles and runs just fine.

It should probably be noted that I can easily see the designer view rendering just fine in Visual Studio with the RibbonGallery element inside of it. It just fails during build.