Adding icon on WPF XAML window causes error/crash VS2012
c#, visual-studio-2012, wpf, xaml
Solution
You just need to set the build action for the actual image/icon to Resource as shown in the properties window..
I know it's an old post, just wanted to share a dummy error..
Problem
I found a bug in WPF XAML when specifying an icon for a XAML Window, trying to run the program generates an error message on the line: ``` System.Windows.Application.LoadComponent(Me, resourceLocater) ``` XamlParseException occurred Provide value on 'System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception.' Line number '5' and line position '100'. I've set the icon to `Always Create` on the `Copy To Output Directory` with no luck. I changed the icon from `Resource` to `EmbeddedResource` - no luck there either. I added it to the `Resources` for the project - still no luck. I've verified the file and its location 100%. The XAML of the window is correct, the name is correct, the path is correct. ``` Icon="Resources/VisualizerIcon.ico" ``` Stumped - online forums say to Copy to output Directory is the solution, but, after building the solution, only the Folder is copied over (even though I explicitly set the ICO file to be copied). Anyone?