I am re-writing a WinForm desktop application in WPF, everything worked fine in WinForm, but I am getting an exception thrown in WPF

The part of the app that is causing issues is reading an XML file and displaying the data in textboxes, pretty basic stuff.

XML:

> 
> 
> ```
> <?xml version="1.0" encoding="utf-8" standalone="no"?>
> <xml xmlns="http://www.w3.org/2000/svg" 
> >
>   <CORE>
>     <HEADER>
>       <name>aaabbbccc</name>
>       <region>Region25</region>
>     </HEADER>
>   </CORE>
> </xml>
> 
> ```
> 
> 

VB.net:

> 
> 
> ```
>     Public Class MainWindow
> 
>       Public filesvg As XDocument
>           Private Sub ReadHeader()
>              filesvg = XDocument.Load(LogFileName)
>              Dim mynode = filesvg...<HEADER>.First()
>              tbName.Text = mynode...<name>.Value
>              tbRegion.Text = mynode...<region>.Value
>           End Sub
> 
>     End Class
> 
> ```
> 
> 

when running this, the XML file is loaded correctly, but then the exception is thrown trying to create mynode.

As I said - all worked fine in WinForms, which is also a .net 4.6 app, exactly the same code. I am using XML literals extensively throughout the code so I have to get this working again in WPF

Things I tried already:

Making it more literal: `Dim mynode = filesvg.<CORE>.<HEADER>.First()`

Using FirstOrDefault: `Dim mynode = filesvg.<CORE>.<HEADER>.FirstOrDefault()`

I must be missing something very basic. Any help will be much appreciated.