View Single Post
Old 12-12-2006   #3 (permalink)
Keith Patrick


 
 

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