PdfPig icon indicating copy to clipboard operation
PdfPig copied to clipboard

NuGet package contains empty UglyToad.PdfPig.Package.dll

Open cremor opened this issue 4 years ago • 4 comments

The PdfPig NuGet package contains the assembly UglyToad.PdfPig.Package.dll which doesn't contain any code. It doesn't really hurt, but I think this assembly should be removed.

cremor avatar Jun 28 '21 12:06 cremor

So the reason for this dll is that the document layout analysis dll is dependent on the main pdfpig dll. I didn't want to make the document layout analysis dll the one that got packaged since the library might grow to support multiple top-level dependent projects, for example if it was ever extended to support HTML to PDF.

This empty package dll is something of a hack to support that https://github.com/UglyToad/PdfPig/blob/master/tools/UglyToad.PdfPig.Package/UglyToad.PdfPig.Package.csproj

EliotJones avatar Jun 30 '21 16:06 EliotJones

I understand why the package project exists. But the created NuGet package wouldn't need the dll, right? So the project is just a replacement for a custom .nuspec file. Isn't there a way to exclude the dll from the created NuGet package?

cremor avatar Jun 30 '21 16:06 cremor

As far as I recall, and it has been a while since I did the original restructure, the idea is you only have to reference/dereference a single dll, the UglyToad.PdfPig,Package.dll which brings in all others in the library, rather than having to reference UglyToad.PdfPig.DocumentLayoutAnalysis.dll and UglyToad.PdfPig.HtmlToPdf.dll (for example).

It simply provides a placeholder for easy use in referencing, but that might not make sense now I type it, I don't recall 🙈

EliotJones avatar Jun 30 '21 17:06 EliotJones

I don't understand that. If I use PdfPig in my project (which I do, thanks for creating it!) I have a <PackageReference> to it in my csproj file. So I reference the package, not individual assemblies of it. And the solution explorer then shows all assemblies that are contained in the package in the "References" node under "compile time assemblies". So as far as I understand it, nothing would change for package consumers if the file UglyToad.PdfPig.Package.dll wasn't included any more.

cremor avatar Jun 30 '21 17:06 cremor

Not sure how to fix this and keep the 2-top-level packages design of UglyToad.PdfPig and layout analysis. Not realistically going to change in the next 3 years

EliotJones avatar Dec 11 '22 20:12 EliotJones