# .NET and More > WPF, WCF, WF >  Error setting background image in WPF using Visual Basic, Visual Basic Studio

## BWilliams

Hi everybody,

I get this error message trying to set a background image for my WPF using Visual Basic in Visual Studio 2013 Express:

"An unhandled exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll

Additional information: 'Provide value on 'System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception.' Line number '7' and line position '14'.

If there is a handler for this exception, the program may be safely continued."

Here is the XAML:

<Window x:Class="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">
    <Grid>
        <Grid.Background>
            <ImageBrush ImageSource="space.jpg"/>
        </Grid.Background>

    </Grid>
</Window>

I don't understand what's wrong...

----------


## jedifuk

try press Ctrl+Alt+E to show Exception Window, and try to check all Thrown checklist, try it again

----------


## BWilliams

I checked off everything in the Thrown checklist, but it still doesn't go through...do I have to have certain things remaining checked in that checklist?

----------


## Turtlechalk

I would review a few of these possible resolutions from the page below as they seem somewhat close to what your issue might be, otherwise head back and we can try again.

http://stackoverflow.com/questions/1...ension-threw-a

----------


## BWilliams

> I would review a few of these possible resolutions from the page below as they seem somewhat close to what your issue might be, otherwise head back and we can try again.
> 
> http://stackoverflow.com/questions/1...ension-threw-a


These are all a little confusing to me, but I will try to look into it.

----------


## BWilliams

Weird - I got it to work.  Before debugging, only placing "space.jpg" in xaml would load the image, but for whatever reason, gave me the crash....once I put the whole file location into xaml...it worked!

"file:///c:/users/pikey10/documents/visual studio 2013/Projects/Mission Control B/Mission Control B/space.jpg"

as opposed to "space.jpg" Even though it still loaded and everything before debugging...

----------


## jedifuk

glad to hear it worked...

----------

