-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File not found when printing from web service #38
Comments
Hi @JeffSE97062 Could you please provide your ".csproj" file? This will help to investigate the issue. |
EmailService.zip |
Hi @JeffSE97062 As I see the issue is in https://github.com/svishnevsky/PDFtoPrinter/blob/master/PDFtoPrinter/build/PDFtoPrinter.targets |
Hi @svishnevsky, your last message said to try 1.3.1 but your link is to 1.3.2. Can you please clarify? |
Hi @JeffSE97062 |
@svishnevsky 1.3.1 installed without errors, but the project wouldn't build because it couldn't find the file "...packages\PDFtoPrinter.1.3.1\buildPDF-XChange Viewer Settings.dat". I copied the file (not sure if version matters??) into the expected folder and the project built successfully, but I received the same error: "The system cannot find the file specified". |
I believe that the file not found is PDFtoPrinter.exe on Process Start. I am getting this error, even with PDFtoPrinter.exe and .dll (as well as PDF-X-Change Viewer Settings.dat) in the bin folder. |
That file is in my bin as well as the dll. Identical setup in a console app works, just not in a web service. Seems to work in a Windows service as well. |
@JeffSE97062 sorry for the long response, it is not easy to reproduce this issue. What approach do you use to build a windows service? I use in person Topshelf and it works fine. |
@svishnevsky I am actually getting the file-not-found error in a .NET web (not Windows) service. I am using VS 2013 .NET 4.5 with the 1.3.1 Nuget package installed. Solution compiles OK. |
This was unblocked by adding "m" to the file name as it is hardcoded in the original util
#38 allow to run multiple instances of PdfToPrinter.exe
I am trying to print from a .NET web service. The exception being thrown is "The system cannot find the file specified". I assume that means the pdf itself, but the file does exist. System.IO.File.Exists(mypdffile) run during debug returns true. The service is running in Visual Studio 2013 framework 4.7 on my local box on which I am an admin. If I use the same code in a console app it works fine. The PDFtoPrinter.dll and PDFtoPrinter.exe are in the project's bin folder.
Update: I noticed a closed post where someone was having the same issue but in a WPF project. A recommendation was to install using Nuget rather than manually (even though that works in a console app). Unfortunately, the install fails and is rolled back:
Thanks for any help.
The text was updated successfully, but these errors were encountered: