It failed to load 'GemBox.Spreadsheet' library

I installed 49.0.0.1839 version of GemBox.Spreadsheet on .NET8.0 project.
It has no problem in build but when I run the program, it throws a below exception :
System.IO.FileNotFoundException: ‘Could not load file or assembly ‘GemBox.Spreadsheet, Version=49.0.0.1839, Culture=neutral, PublicKeyToken=b1b72c69714d4847’. The system cannot find the file specified.’

I confirmed the dll is located in ‘%currentuser%.nuget\packages\gembox.spreadsheet\49.0.1839\lib\net6.0-windows7.0\GemBox.Spreadsheet.dll’.

I deleted/reinstalled the package but still same. Could anyone help this?

How are you adding a reference to GemBox.Spreadsheet, can you show us the relevant XML in your CSPROJ file?

I believe you’re missing setting the Copy Local property of your reference to True.

Regards,
Mario

Hi Mario, Thank you for reply.

I installed Gembox using Nuget package, so it has no Copy Local property. Here is the XML in project file and properties.

property

I tied to set ‘PrivateAssets’ and ‘CopyToOutputDirectoy’ but still same.

Can you please send us a small Visual Studio project that reproduces your issue so we can investigate it?