We are updating GemBox.Document from 35.0.1300 to 35.0.1538.
Our project is in .Net Framework 4.8.
This version has a new transitive dependency to SkaSharp. When restoring Nuget package, there’s two broken references that appears under the project where GemBox is installed and every other project in the solution that references this project.
Steps to reproduce
In Visual Studio 2022, create a new .Net Framework Console App targetting .Net Framework 4.8
Build the solution
Install GemBox.Document version 35.0.1538 in the project, in PackageReference format (no package.config file)
Build the solution : usually here it’s fine
Clean solution
Close Visual Studio
Reopen Visual Studio and the solution
Restore packages
Build solution
If someone else clone this repo, they got the same problem if they
Note that you can reproduce this issue without using GemBox.Document.
In other words, remove the <PackageReference> for GemBox.Document and add one for SkiaSharp or HarfBuzzSharp. Do those same steps and you’ll notice that the same warning appears.
The issue is related to the package dependency that those libraries have, the native assets for macOS.
Anyway, I noticed that the issue occurs only when using an older format for the project (non-SDK version) and the newer format for the NuGet packaging (<PackageReference>). It seems that this combination doesn’t work well for those packages.
So the solution is to either use the older Nuget package installation (packages.config) or the newer project format (<Project Sdk="Microsoft.NET.Sdk">).
What fixed the build for me was to add ExcludeAssets="buildTransitive" to my reference, as suggested as workaround in the linked issue: <PackageReference Include="GemBox.Bundle" Version="47.0.1370" ExcludeAssets="buildTransitive" />
But I am not sure, if that has any unintended side effects, which I did not notice so far.
I still get the build error when including the packages individually as above.
The project I get the errors with uses the “Microsoft.NET.Sdk.Web” SDK and has the target framework .net472.
Do I have to handle it differently?
I uploaded a minimal repro project here: GitHub - SarahAmagno/ReproGemBox
The issue should be reproducible by building the only project in the solution.
The build fails unless the package reference is changed to <PackageReference Include="GemBox.Bundle" Version="47.0.1370" ExcludeAssets="buildTransitive" />
this fixes the build but I am not sure about the possible side effects changing this setting has on the project’s publishing behaviour. However, I will use it as a workaround as long as I don’t notice any further problems.