Error MSB3341 on .NET 5

I’ve got a compile error preventing me from moving forward. I was able to reproduce this in an empty .net core console application.

  1. Create a new .net 5 console project, in this case, I named it Console5 (I created this via Visual Studio 2019 latest)
  2. Go to the project folder via the CLI, in my case this is c:\Code\Console5 and type dotnet build
  3. Go into Visual Studio and add the Nuget Package for Gembox.Pdf (this is version 15.0.10.62)
  4. Return to the command line, do a dotnet build, you receive an error.

Via CLI:

MSB4062 Error

C:\Program Files\dotnet\sdk\5.0.102\Microsoft.Common.CurrentVersion.targets(2016,5): error MSB4062: The “Microsoft.Build.Tasks.ResolveNativeReference” task could not be loaded from the assembly Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [C:\Code\Console5\Console5.csproj]

Via Visual Studio (show in the Error List Warnings):

Severity Code Description Project File Line Suppression State
Warning MSB3341 Could not resolve reference “C:\Users\user.nuget\packages\gembox.pdf\15.0.1062\buildTransitive\netstandard2.0…\build\netstandard2.0\libpkcs11-mock.a”. If this reference is required by your code, you may get compilation errors. Console5 C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets 2016

Hi Jason,

Please try again with this NuGet package:

Install-Package GemBox.Pdf -Version 15.0.1069-hotfix

Does this solve your issue?

Regards,
Mario

That did it, thank you!