MissingMethodException after updating visual studio to latest

61 views
Skip to first unread message

Glayson Patricio

unread,
Nov 14, 2022, 12:30:13 PM11/14/22
to Excel-DNA
Hi everyone.

This week I updated visual studio and all the nuget packages from microsoft used in my solution, and now I am getting the exception below:

"MissingMethodException: Method not found: 'Void System.Windows.Forms.Control.set_Font (System.Drawing.Font)'

From:
ExcelDna.Logging.LogDisplayForm.LogDisplayForm()
ExcelDna.Logging.LogDisplayForm.ShowForm()

Visual studio also updated the .net 6 version to latest.

Any tips on what could be going on ?
Is anyone getting similar errors ?

Thanks, Glayson

Govert van Drimmelen

unread,
Nov 14, 2022, 3:51:01 PM11/14/22
to exce...@googlegroups.com

Hi Glayson,

 

I tried an add-in targeting .NET 6, with this function:

 

        public static string SayHello(string name)

        {

            LogDisplay.WriteLine("Hey there!");

            LogDisplay.Show();

            return "Hello " + name;

        }

 

It works fine for me.

 

I running ExcelDna.AddIn v1.6.1-alpha6, VS 2022 v17.4.0 and .NET v6.0.11.

 

What are your versions?

 

-Govert

--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/exceldna/c829b62b-0d34-46d7-aadf-73a57a2c1e26n%40googlegroups.com.

Glayson Patricio

unread,
Nov 16, 2022, 6:57:58 AM11/16/22
to Excel-DNA
Govert,

Thankyou very much for your support, reading and helping us with every question!

I stayed the last few days doing several types of tests (reinstalling visual studio, net 6.0, net 7.0, downgrading the nuggets, etc...)
And I was able to find the what is causing the problem.

The problem is caused when I Upgrade the Nuget SYSTEM.DATA.OLEDB from version 6.0.0 To 7.0.0

when the 7.0.0 version is used, several new files are created at the "runtimes/win/lib/net6.0" folder.
one of them is the "System.Drawing.Commom" which i believe is the cause of the problem.

After downgrading this package, everything seems normal again.

Thankyou very much.

Glayson

Reply all
Reply to author
Forward
0 new messages