logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
amirmi  
#1 Posted : Tuesday, June 6, 2023 6:44:21 AM(UTC)
amirmi

Rank: Newbie

Groups: Registered
Joined: 6/6/2023(UTC)
Posts: 1
Israel

Hello,

I am trying to build a Plugin for a 3rd party application, in which I am trying to load a PDF file.
I use pdfium library but every time I try to open the WPF view in that 3rd party application I get this error:
"FileNotFoundException: could not load file or assembly 'Patagames.Pdf.Wpf....' or one of its dependencies. The system cannot find the file specified"
UserPostedImage
I installed pdfium.NET.SDK with NuGet in Visual Studio, everything seems to be correct in the project structure.

[Edit 06/06/2023]:
Under my Control I added PdfCommon.Initialize():
public PnIDControl()
{
InitializeComponent();
PdfCommon.Initialize();

}

This is how my main c# file look like:
public class PnIDPlugin : DockPanePlugin
{
public override Control CreateControlPane()
{
// WindowForm control to host WPF elem
ElementHost elemHost = new ElementHost
{
//assign wpfcontrol
AutoSize = true,
Child = new PnIDControl()
};
//create control
elemHost.CreateControl();

return elemHost;
}

And now I get this error:
Quote:
Could not load file or assembly 'Patagames.Pdf, Version=11.76.43.48, Culture=neutral, PublicKeyToken=60fd6cf9b15941cf' or one of its dependencies. The system cannot find the file specified.


Can anyone suggest what am I doing wrong?

Thank you!

Edited by user Tuesday, June 6, 2023 1:14:04 PM(UTC)  | Reason: Not specified

Paul Rayman  
#2 Posted : Sunday, June 25, 2023 9:10:22 AM(UTC)
Paul Rayman

Rank: Administration

Groups: Administrators
Joined: 1/5/2016(UTC)
Posts: 1,095

Thanks: 7 times
Was thanked: 128 time(s) in 125 post(s)
Hello,

1. Make sure that the assembly file is not marked by Windows as a file downloaded from the Internet.
blocked_file.png (39kb) downloaded 0 time(s).

2. You can subscribe to the AppDomain.CurrentDomain.AssemblyResolve event to see which exactly assembly cannot be found and what's really going on.
bav  
#3 Posted : Monday, October 2, 2023 9:57:06 AM(UTC)
bav

Rank: Newbie

Groups: Registered
Joined: 1/11/2023(UTC)
Posts: 7
United States

I'd like to chime in and say that this is a very frustrating issue. Somehow I was able to resolve previously, however, I updated Pdfium.Net.SDK and now I am having the same issue once again. Surely there has to be a way to make this more seamless. Once again the PDF renderer in my application is throwing this exception.

Could not load file or assembly 'Patagames.Pdf, Version=11.78.45.2020, Culture=neutral, PublicKeyToken=60fd6cf9b15941cf' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

This is the hierarchy of the applicable projects


  • WPF Project
    • .Net Framework 4.7.2
    • Uses Patagames.Pdf.dll v11.78.45.472

  • Shared Control Library
    • .Net Framework 4.7.2
    • Uses Patagames.Pdf.dll v11.78.45.472

  • Shared Low level utility library
    • Netstandard 2.0
    • Looking for Patagames.Pdf.dll v11.78.45.2020




The WPF project invokes the Pdfium viewer control, which lives in the shared control library. Prior to doing so, it makes a call to the license load function, which lives in the shared low level utility library. This is the call that is throwing the error.

On different note, I'm trying use this same Netstandard 2.0 project in a function within a docker container. That is not working either. It is having trouble loading Pdfium.dll. It's becoming hard to justify trying to use this library. No other packages give me these issues.

Edited by user Monday, October 2, 2023 10:01:33 AM(UTC)  | Reason: Not specified

Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.