The error indicates it isn't finding the images. Your XAML is relying on the image actually being deployed on disk like it is when you're in the designer. This is not going to be true unless you mark the image file as content (using Build Action property of the file in Solution Explorer). That would then cause the file structure to be available at runtime. But that is non-standard. Normally you would embed the image as a resource instead. You can read about how to do that here. In either case you need to modify your XAML to use the correct image source URL and you need to ensure the image is available (either on disk or as a resource) otherwise you get the error you're seeing now.
Why am I getting a XamlParseException?

Nicholas Piazza
466
Reputation points
I'm getting
254912-xamlparseexception.png
when I run the application. I have put my image files in an Images folder in the same folder as the project file. The XAML designer seems to locate them fine as shown in
254913-mainwindowimages.png
but the exception is being reported on the following MainWindow.Xaml line
<ribbon:RibbonButton SmallImageSource="Images\SmallIcon.png" />
Why am I getting this exception and how do I correct it?