I’m developing a Windows Forms application targeting .NET Framework 4.8 in Visual Studio and am running into a FileNotFoundException for Interop.AcroPDFLib.dll at runtime. The DLL is an interop assembly for the Adobe PDF Reader COM component and is used to embed PDF viewing functionality within the application.
Here’s the exception message I’m encountering:
System.IO.FileNotFoundException: Could not load file or assembly ‘Interop.AcroPDFLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5074229e38b33c31’ or one of its dependencies. The system cannot find the file specified.
File name: ‘Interop.AcroPDFLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5074229e38b33c31’
I’ve noticed that the Copy Local property for this reference is set to False and is greyed out in Visual Studio (I’m using 2022) preventing me from setting it to True.
Here’s the relevant section of the .csproj file:
<Reference Include="Interop.AcroPDFLib">
<HintPath>objDebugInterop.AcroPDFLib.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
I’ve tried manually setting the Private property to True in the .csproj file to ensure that the DLL is copied to the binDebug folder, but this hasn’t resolved the issue.
Any guidance would be much appreciated as I’ve hit a wall trying to figure this out.
Thank you!!
I’ve tried manually setting the Private property to True in the .csproj file to ensure that the DLL is copied to the binDebug folder, but this hasn’t resolved the issue.