svishnevsky / PDFtoPrinter

.Net Wrapper over PDFtoPrinter util allows to print PDF files.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

use `<PublishSingleFile>true</PublishSingleFile>` not found directory name.

juner opened this issue · comments

commented

It works fine when I debug it, but when I publish it and run it, it doesn't work.

As far as I can see the source, here I am getting DirectoryName from Location

return Path.Combine(
Path.GetDirectoryName(
(Assembly.GetEntryAssembly() ?? Assembly.GetExecutingAssembly()).Location),
utilName);

Shouldn't it fall back to AppContext.BaseDirectory if the Location return value is an empty string?

see dotnet/corert#5467

sample project: https://github.com/juner/PdfToPrinterNotWorkSample_20230214

Hi @juner
Thanks for reporting the issue. Could you please try version 1.5.0 and let me know if it helped?

commented

@svishnevsky
it worked fine
Thank you very much! !