HakanL / WkHtmlToPdf-DotNet

C# .NET Core wrapper for wkhtmltopdf library that uses Webkit engine to convert HTML pages to PDF.
GNU Lesser General Public License v3.0
366 stars 66 forks source link

Exclude runtimes folder from publish #101

Closed natanaelfiorilla closed 1 month ago

natanaelfiorilla commented 1 year ago

Hi, Is it possible to exclude the runtimes folder on publish?

dotnet publish "" --output "/bin/Release/net6.0/publish" --configuration "Release" --framework "net6.0" /p:GenerateRuntimeConfigurationFiles=true --runtime linux-x64 --self-contained False

Publishing for a lambda includes /runtimes/win-x64 and /runtimes/win-x86. Unfortunately, any attempt to exclude the folder using csproj file does not work. Maybe I'm not doing it correctly. Thanks!

HakanL commented 1 year ago

Good question, I don't know if there is a way to filter the runtime files based on target.

RomanHubyak commented 1 year ago

https://github.com/HakanL/WkHtmlToPdf-DotNet/pull/60 - The fix for .NET Framework affects .NET Core and it results in x3 binaries: 2 in /runtimes for x86 and x64, and 1 in root for the target runtime.

image

andulv commented 9 months ago

Found a workaround that seems to solve the problem for me.

Edited .csproj file of my procject that references WkHtmlToPdfDotNet:

    <PackageReference Include="Haukcode.WkHtmlToPdfDotNet" Version="1.5.86" >
      <ExcludeAssets>build</ExcludeAssets>
    </PackageReference>