Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista Tutorial - Help! XmlDataProvider 'cannot locate resource'

 
 
Old 11-27-2006   #1 (permalink)
Larry Andersen
Guest


 
 

Help! XmlDataProvider 'cannot locate resource'

Hi there,

I'm trying to do a simple binding to an external xml file that is located on
my hard drive in the same director as the application source code. I set up
an XmlDataProvider as follows in my xaml:

<XmlDataProvider x:Key="XmlDS" Source="Kiosk.xml"/>

When I execute the app, I get an IOException that says "cannot locate
resource 'kiosk.xml'"

I've tried changing the source to the following:

"Kiosk.xml"
"\Kiosk.xml"
".\Kiosk.xml"
"..\..\Kiosk.xml"
"file://kiosk.xml"

None of the above work.

If I embed the xml file in the assembly, everything works fine.

Is there something I'm missing?

Thanks.

--
New to EID and loving it

My System SpecsSystem Spec
Old 12-12-2006   #2 (permalink)
Keith Patrick
Guest


 
 

Re: Help! XmlDataProvider 'cannot locate resource'

Did you ever find a solution to this? I'm getting bit by it as well. I can
embed the file, but I need the file to be writeable, so it needs to be a
separate datafile. However, the runtime keeps wanting to assume the file is
packed into the assembly (I keep my code in Proj/Source, and it keeps
telling me it can't find source/datafile.xml, even though I only set
Source="datafile.xml")
I keep reading about people saying it's possible, but I have not found a
single example doesn't use absolute paths


"Larry Andersen" <LarryAndersen@discussions.microsoft.com> wrote in message
newsFF8E711-E5A5-4D27-957B-8F848296F042@microsoft.com...
> Hi there,
>
> I'm trying to do a simple binding to an external xml file that is located
> on
> my hard drive in the same director as the application source code. I set
> up
> an XmlDataProvider as follows in my xaml:
>
> <XmlDataProvider x:Key="XmlDS" Source="Kiosk.xml"/>
>
> When I execute the app, I get an IOException that says "cannot locate
> resource 'kiosk.xml'"
>
> I've tried changing the source to the following:
>
> "Kiosk.xml"
> "\Kiosk.xml"
> ".\Kiosk.xml"
> "..\..\Kiosk.xml"
> "file://kiosk.xml"
>
> None of the above work.
>
> If I embed the xml file in the assembly, everything works fine.
>
> Is there something I'm missing?
>
> Thanks.
>
> --
> New to EID and loving it



My System SpecsSystem Spec
Old 12-12-2006   #3 (permalink)
Keith Patrick
Guest


 
 

Re: Help! XmlDataProvider 'cannot locate resource'

It took a bit of hunting down (something in my head told me to check out the
pack format, since I struggled with merged resourcedictionaries ages ago),
but here's a working format:
pack://siteoforigin:,,,/Kiosk.xml



"Keith Patrick" <richard_keith_patrick@nospam.hotmail.com> wrote in message
news:OY6K%23EjHHHA.960@TK2MSFTNGP04.phx.gbl...
> Did you ever find a solution to this? I'm getting bit by it as well. I
> can embed the file, but I need the file to be writeable, so it needs to be
> a separate datafile. However, the runtime keeps wanting to assume the
> file is packed into the assembly (I keep my code in Proj/Source, and it
> keeps telling me it can't find source/datafile.xml, even though I only set
> Source="datafile.xml")
> I keep reading about people saying it's possible, but I have not found a
> single example doesn't use absolute paths
>
>
> "Larry Andersen" <LarryAndersen@discussions.microsoft.com> wrote in
> message newsFF8E711-E5A5-4D27-957B-8F848296F042@microsoft.com...
>> Hi there,
>>
>> I'm trying to do a simple binding to an external xml file that is located
>> on
>> my hard drive in the same director as the application source code. I set
>> up
>> an XmlDataProvider as follows in my xaml:
>>
>> <XmlDataProvider x:Key="XmlDS" Source="Kiosk.xml"/>
>>
>> When I execute the app, I get an IOException that says "cannot locate
>> resource 'kiosk.xml'"
>>
>> I've tried changing the source to the following:
>>
>> "Kiosk.xml"
>> "\Kiosk.xml"
>> ".\Kiosk.xml"
>> "..\..\Kiosk.xml"
>> "file://kiosk.xml"
>>
>> None of the above work.
>>
>> If I embed the xml file in the assembly, everything works fine.
>>
>> Is there something I'm missing?
>>
>> Thanks.
>>
>> --
>> New to EID and loving it

>
>



My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
Locate MAC from IP with WMI PowerShell
Can't locate network Vista networking & sharing


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46