Resource Not found when replacing demo xps with mine

Mar 15, 2011 at 6:02 PM

I am evaluating Document viewer and loaded up the simple document viewer demo and it ran fine with the DOcument Toolkit.xps. I replaced the xps with 2 different xps I created from Word 2003, using he XPS printer. Both of them resulted in a Resource '<filename>.xps' not found at: this.DataSource.PackageReader =  new DefaultPackageReader(new Uri("<filename>.xps", UriKind )) I put m files in the same location as Document Toolkit.xps

Is there some conversion step I am missing where it is not recognized as the correct format?



Mar 15, 2011 at 6:05 PM

Hi Mike,

Please ensure you set the build action of your XPS documents to Content.

- Koen

Mar 22, 2011 at 6:28 PM
Edited Mar 22, 2011 at 6:28 PM

I did that and that works but...

I am trying to build a generic reader that can pull up any xps in the folder. Does this mean I have to recompile everytime an author uploads a new xps? I was hoping to have the user just select which doc to read and let the authors upload new docs to the website as they complete them. As authors upload a doc I modify an XML with the Title, filename, description etc. and then use that info to load up the xps into the reader.

Thanks for the quick reply, sorry I was so late getting back to you. I was in the tail end of a project that went into production and have been tied up with that. Now I am back on this.

BTW I am using the SharpZipLib package reader now. I saw a snippet where the user could select a file to read and thought maybe I needed to use this package reader. I figured if they could grab one off thier hard drive I could load one from ClientBin, but alas no joy.

I am moving from the aspnet forms world into silverlight so please let me know if I a missing something obvious. Do I need to load from a stream or webservice instead?

Thanks  Mike

Mar 22, 2011 at 9:27 PM

Nevermind, If I had read some of the earlier posts, I would have seen the answer.