"There is no unicode byte order mark:cannot switch to unicode" error while loading wit

I'm trying to load the Application.MyApp file and am using Visual Studio 2005 june ctp. This file is a new file generated by visual studio and is the "code behind" all VB Projects in VS 2005. I need to load this file and retreive a piece of information i cant seem to find anywhere else, but I'm running into this error! This error pops when I execute the doc.Load(filename) member.

is there a way to force it to use a specific byte order? I find nothing in the XmlDocument class that looks like it might effect this.

Thanks in advance

Bill
The file looks like:

<?xmlversion="1.0"encoding="utf-8"?>

<MyApplicationDataxmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<MySubMain>true</MySubMain>

<MainForm>Form1</MainForm>

<SingleInstance>false</SingleInstance>

<ShutdownMode>0</ShutdownMode>

<EnableVisualStyles>true</EnableVisualStyles>

<AuthenticationMode>0</AuthenticationMode>

<ApplicationType>0</ApplicationType>

<SaveMySettingsOnExit>true</SaveMySettingsOnExit>

</MyApplicationData>

[3996 byte] By [BillFoust] at [2008-2-28]
# 1
Usually it happens when you have ANSI (or any one byte) encoded file with xml header
<?xml version="1.0" encoding="utf-16" ?>

Hack: you can read this file into string and use LoadXml()

TheXMLMan at 2007-9-9 > top of Msdn Tech,.NET Development,XML and the .NET Framework...
# 2

You can also get errors the other way, when the file starts with unicode byte order mark (FF FE) but then contains a different encoding attribute.

ChrisLovett at 2007-9-9 > top of Msdn Tech,.NET Development,XML and the .NET Framework...

.NET Development

Site Classified