Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6122005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:50:56+00:00 2026-05-23T15:50:56+00:00

I have made a wpf standalone application for accounting purposes. The application works and

  • 0

I have made a wpf standalone application for accounting purposes. The application works and prints well to an external printer or microsoft XPS printer. The problem arises when i select doPDF(an application which outputs a pdf file) as printer. The output is just fine; it creates the pdf file and saves it, but, when i come back to the application and press any button, an XamlParseException was unhandled error is thrown which says

‘The invocation of the constructor on type ‘RegisterMaintenance.DisplayInvoice’ that matches the specified binding constraints threw an exception.’ Line number ‘5’ and line position ‘7’

InnerException: Verify that the file exists in the specified location

InnerException: When using relative paths, make sure the current directory is correct

Why is this happening and what can i do to get rid of this problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T15:50:56+00:00Added an answer on May 23, 2026 at 3:50 pm

    Seems that this pdf printer changes the current directory for the process.
    I can think of 2 possible workarounds for your problem.

    The first and most obvious workaround for your problem would be to use a absolute path for “Transactions.xml” and store this in your app.config. This might however become problematic if your application is ditributed to various different machines and installed in different locations.

    The second workaround is to temporarily store your current working directory before calling the print function, and then restore it afterwards, if it has changed. Something like this:

    string path = Directory.GetCurrentDirectory();
    //Do the print stuff
    Directory.SetCurrentDirectory(path);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a problem guys i made a wpf applications its running well but
i have made an application having entity framewrok. It is wpf application, now it
I made a small WPF application to slide UserControls in and out, the problem
I have a problem with WPF triggers. In my application i used a multitrigger
Im using WPF and C#. I have an application with an OnScreenKeyboard made with
I have made an Excel VSTO Application(WPF) which call a WCF working with IIS
C#, WPF, Windows 7, PC, Visaul Studio 2010 Application Easytask I have made an
I have the following problem: I made a UserControl in WPF which has an
I have a WPF application written in C#. I have made a button. I
I'm just playing around with WPF and MVVM, and I have made a simple

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.