Debug config file loading

26 views
Skip to first unread message

Gerhard Duennebeil

unread,
Oct 7, 2021, 1:23:04 AM10/7/21
to Excel-DNA

Hi there,

new to ExcelDNA, new to .NET.
A bit lost in the woods.

I successfully managed to write some UDF code which works fine but has quite some properties hard coded yet.
Thus I tried to introduce config files following the instructions here:

Result: Doesn't work.
So obviously I am doing something wrong here. But what?

To find out I tried to enable debug logging following this directions:

So I find myself in a vicious circle. To debug my problems I need exactly that mechanism which I want to troubleshoot.

Is there an alternative way (e.g. setting an ENV variable or a command line switch or ...) to enable logging of the startup phase?

BR
Gerhard

Govert van Drimmelen

unread,
Oct 7, 2021, 3:44:28 AM10/7/21
to exce...@googlegroups.com

Hi Gerhard,

 

The .xll.config files should work fine, making you need to make sure they are copied to the output directory with the right name.

Visual Studio and the Excel-DNA build task can be a bit quirky about this.

You need to check that the name and extension and everything line up.

 

I see there is a sample project (with a somewhat old version of Excel-DNA) here: Samples/Logging at master · Excel-DNA/Samples (github.com)

You can try that, or else you can make or share your own problem sample project on GitHub or elsewhere and I’m happy to check.

 

-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/458c4df7-74a9-4aaf-a0db-b69654f6a278n%40googlegroups.com.

Gerhard Duennebeil

unread,
Oct 7, 2021, 4:21:07 AM10/7/21
to Excel-DNA
Just checked,
no config file at all in the output directory.
Maybe that IS already the problem.

But just to make sure...what exactly is meant with the term "TheAddInName"?
Is this the name of the output file as seen in the bin/xxx-Directory?
Or is it taken from one of the settings from those numerous config files of VS?Or maybe the class name where the functions are implemented?

BR
Gerhard

Govert van Drimmelen

unread,
Oct 7, 2021, 4:26:10 AM10/7/21
to exce...@googlegroups.com

Hi Gerhard,

 

If the file that is loaded into Excel is called

    MyProject-AddIn64.xll

then you need

    MyProject-AddIn64.xll.config

 

 

It should work if you add a file to your Visual Studio project called “App.config” and make sure it is marked as

Build Action: None

Copy to Output Directory: Do not copy

 

Such a file is picked up by the Excel-DNA build task, and copied with the right names in the output directory.

Gerhard Duennebeil

unread,
Oct 7, 2021, 4:33:39 AM10/7/21
to Excel-DNA
"App.Config" did the trick. Prevously I had a file <<MyPluginName>>.xll.config added directly to the project which was obviously ignored.

Thx for the help
Gerhard
Reply all
Reply to author
Forward
0 new messages