My program uses adobe reader dll to display pdf within a form. In visual studio the program works correctly, but when I run it out of vs 2019 it presents an error. I believe it's some missing reference.
OBS: before the project was in version 4.7.2 of .net. I've updated the entire program to 4.8. Maybe this caused some mismatch? Incompatibility that does not exist when running the program direct by vs.
PDFView_Load:
private void PDFView_Load(object sender, EventArgs e)
{
try
{
PDFViewObj.src = @"C:\Biblioteca Fácil\tempPDF.pdf"; //this file is created by other class
}
catch(COMException)
{
//Recovery options here
Error = true;
this.Close();
}
}
This is my Exception that just occurs if executed outside the vs 2019:
System.Runtime.InteropServices.COMException (0x80004005): Erro HRESULT E_FAIL was returned from a call to the COM component.
in AcroPDFLib.IAcroAXDocShim.set_src(String pVal)
in AxAcroPDFLib.AxAcroPDF.set_src(String value)
in biblioteca.PDFView.PDFView_Load(Object sender, EventArgs e) na C:\Users\manoe\Documents\Backup de segurança\Biblioteca\biblioteca\biblioteca\PDFView.cs:linha 16
in System.Windows.Forms.Form.OnLoad(EventArgs e)
in System.Windows.Forms.Form.OnCreateControl()
in System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
in System.Windows.Forms.Control.CreateControl()
in System.Windows.Forms.Control.WmShowWindow(Message& m)
in System.Windows.Forms.Control.WndProc(Message& m)
in System.Windows.Forms.ScrollableControl.WndProc(Message& m)
in System.Windows.Forms.Form.WmShowWindow(Message& m)
in System.Windows.Forms.Form.WndProc(Message& m)
in System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
in System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
in System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)