Results 1 to 4 of 4

Thread: [RESOLVED] [WPF &VB.neT] can't get browser app to open documents in same directory

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2009
    Posts
    46

    Resolved [RESOLVED] [WPF &VB.neT] can't get browser app to open documents in same directory

    Got my browser app almost up and running, however I have one major issue preventing me from releasing to my team.

    I've got the app up and running, however when a user clicks on a topic in a treeview item, the browser displays an error, and looking at the log, I see the following:

    System.IO.FileNotFoundException: Could not find file 'C:\WINDOWS\system32\Cannot pass POST.xps'.
    The problem is, is that these xps files are located in the directory with the application (on a webserver or UNC path, say //server/directory/application)

    In my code, I don't reference any path, so how can I get it to stop looking in the windows system32 folder?

    The code to load the documents is:
    Code:
    Dim xps As New XpsDocument(TreeView1.SelectedValue + ".xps", System.IO.FileAccess.Read)
                DocumentViewer1.Document = xps.GetFixedDocumentSequence()

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: [WPF &VB.neT] can't get browser app to open documents in same directory

    include the path.... if necessary, get the startup path from the application object, and prepend that to your file name.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Member
    Join Date
    Aug 2009
    Posts
    46

    Re: [WPF &VB.neT] can't get browser app to open documents in same directory

    Quote Originally Posted by techgnome View Post
    include the path.... if necessary, get the startup path from the application object, and prepend that to your file name.

    -tg
    techgnome... thanks for that, actually I dont know what went wrong, I think I had an old copy of the xbap cached in IE or something, as when I changed the version # in the assembly and republished with the app path, it worked.

    Thanks!

  4. #4
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: [RESOLVED] [WPF &VB.neT] can't get browser app to open documents in same director

    Even so you should still always specify the full path to avoid problems like this on your user's machines.
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width