System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception.' Line number '6' and line position '10

c#, wpf, wpf-controls

Solution

@HighCore is right, using application solves your issue in the given scenario

    <ImageBrush ImageSource="pack://application:,,,/Resources/ClientBackground.png"/>

You still can use siteoforigin. For that you have to set the image property

Copy to Output Directory to "Copy always"

MSDN Link

Problem

I have add an Image resource for the wpf project am making by: `right-click on the Project -> Properties -> Resources -> Images -> From Existing -> ClientBackGround.png` and I made it background for the main window : ``` <Window x:Class="Illuminate_AutoPatcher.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Width="1000" Height="750" ResizeMode="NoResize" WindowStyle="None" WindowStartupLocation="CenterScreen"> <Window.Background> <ImageBrush ImageSource="pack://siteoforigin:,,,/Resources/ClientBackground.png"/> </Window.Background> <Grid> <Button Content="" HorizontalAlignment="Left" VerticalAlignment="Top" Width="224" Margin="766,613,0,0" Height="124" > </Button> </Grid> </Window> ``` but it's not working it's keep throwing this anoying error `System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception.' Line number '6' and line position '10` , how I supposed to fix it, so I use static resources that's build with the project?

Original source