Raw exception of type " System.Windows.Markup.XamlParseException " in PresentationFramework.dll

Additional information: "Providing a value for" System.Windows.Baml2006.TypeConverterMarkupExtension "caused an exception.": Line number "6" and position in line "10".

When adding a background image for any element, this error appears. All the ways are there, everything is correct, even in the designer everything is correct. Tell me, what can this be caused? 6 line - just the line where the background image ( XAML ) is added.

The most common markup:

 <Window x:Class="Project.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525" WindowStyle="None"> <Window.Background> <ImageBrush ImageSource="pack://siteoforigin:,,,/Resources/Background.png"/> </Window.Background> <Grid Height="300" Width="500" Margin="6,28,6,6" Background="White"> </Grid> </Window> 

Tried both through resources and through normal paths ( ImageSource="img/Background.png" ).

  • You give the markup itself, and it is unlikely that anyone in the coffee grounds will be guessing - Donil
  • one
    siteoforigin wrong, it's a placeholder. Read the documentation about what you need. Most likely, application . - VladD
  • I have a designer defined. Strange. Thank you - iKNG
  • Replaced with application , it still does not work - iKNG

1 answer 1

Who shoots a similar exception, see the properties of the image "Action at construction": Resource

See http://www.cyberforum.ru/post6254212.html