I am using Excel-DNA 1.7.0.
I have been working on this project for some weeks and everything has been running fine. I am using Visual Studio 2022 and running Office 365. Then I started getting errors when the debugger runs the project. It happens after the Excel splash screen shows.
I get the first error message below when running under the Visual Studio debugger and then the error message after the first one when I run from Excel (no debugger).
Two things happened just before this: 1) I tried using the Excel-DNA Intelisense. That didn’t work on the first try to I removed that package. 2) A few hours after this problem shows I was told that the virus scanner flagged my .xll as potential malware.
I have read several posts on this site that might pertain to my problem but haven’t had any luck.
Oddly, when I get the Excel error (second one below) I can “Continue” and it will run the last .xll that I had before the problem surfaced just fine. That .xll is still in place under the Excel Add In list.
I am looking for some potential paths forward.
Thanks.
*********************************************************
System.Reflection.TargetInvocationException
HResult=0x80131604
Message=Exception has been thrown by the target of an invocation.
Source=System.Private.CoreLib
StackTrace:
at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) in System.Reflection\RuntimeMethodInfo.cs:line 464
<snip>
This exception was originally thrown at this call stack:
[External Code]
Inner Exception 1:
MissingMethodException: Method not found: 'Void System.Windows.Forms.Control.set_Font(System.Drawing.Font)'.
****************************************************************
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.MissingMethodException: Method not found: 'Void System.Windows.Forms.Control.set_Font(System.Drawing.Font)'.
at ExcelDna.Logging.LogDisplayForm.InitializeComponent()
at ExcelDna.Logging.LogDisplayForm..ctor()
at ExcelDna.Logging.LogDisplayForm.ShowForm()
*************************************************************