Debug Command Line Argument behavior difference between V 0.34.6 and V1.0

208 views
Skip to first unread message

Kirk Woodhouse

unread,
May 14, 2019, 2:28:51 PM5/14/19
to Excel-DNA
In Excel-DNA V 0.34.6 I was able to put a file name (fully qualified path) in the command line argument of the Debug tab in the project properties.  The file would open when pressing F5.  In Excel-DNA V 1.0 the file name is being overwritten with the (unqualified) name of the .xll.  The target file does not open.

Caio Proiete

unread,
May 14, 2019, 5:10:46 PM5/14/19
to exce...@googlegroups.com
Hi Kirk,

That is by design. By default, the start directory is the bin\Debug or bin\Release (depending on your build configuration) where your .XLL is, which is why a relative path is used.

Do you have anything special in your project that is changing that? Would you be able to put together a reproducible example of that behavior and upload it to our GitHub?


On Tue, May 14, 2019 at 3:28 PM Kirk Woodhouse <kirk...@gmail.com> wrote:
In Excel-DNA V 0.34.6 I was able to put a file name (fully qualified path) in the command line argument of the Debug tab in the project properties.  The file would open when pressing F5.  In Excel-DNA V 1.0 the file name is being overwritten with the (unqualified) name of the .xll.  The target file does not open.

--
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 post to this group, send email to exce...@googlegroups.com.
Visit this group at https://groups.google.com/group/exceldna.
To view this discussion on the web visit https://groups.google.com/d/msgid/exceldna/f5395b8b-e56c-41ff-954f-e39ea8a0e7b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kirk Woodhouse

unread,
May 14, 2019, 5:25:29 PM5/14/19
to Excel-DNA
Hi Caio,
I am not quite sure what you are asking for in terms of a reproducible behavior.  Sorry for restating if you got my input the first:  V 0.34.6 allowed me to specify a 'test' workbook I wanted to open in Debug mode.  Pressing F5 would build the project, run the new version of the .XLL and open the workbook.  V 1.0 appears to have a different behavior:  it overwrites the workbook name with the .XLL file name and obviously doesn't open the 'test' workbook .  The ability to have a 'test' workbook automatically open when stating a debug session was very convenient/valuable.


On Tuesday, May 14, 2019 at 5:10:46 PM UTC-4, Caio Proiete wrote:
Hi Kirk,

That is by design. By default, the start directory is the bin\Debug or bin\Release (depending on your build configuration) where your .XLL is, which is why a relative path is used.

Do you have anything special in your project that is changing that? Would you be able to put together a reproducible example of that behavior and upload it to our GitHub?


On Tue, May 14, 2019 at 3:28 PM Kirk Woodhouse <kirk...@gmail.com> wrote:
In Excel-DNA V 0.34.6 I was able to put a file name (fully qualified path) in the command line argument of the Debug tab in the project properties.  The file would open when pressing F5.  In Excel-DNA V 1.0 the file name is being overwritten with the (unqualified) name of the .xll.  The target file does not open.

--
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 exce...@googlegroups.com.

Kirk Woodhouse

unread,
May 14, 2019, 5:36:53 PM5/14/19
to Excel-DNA
Caio,
Perhaps picture will help.  This works with V 0.34.6.

Project Build Debug Screen.PNG

Caio Proiete

unread,
May 14, 2019, 8:40:38 PM5/14/19
to exce...@googlegroups.com
Hi Kirk,

Now I got it! In your first message, I understood you were talking about defining a custom path for the add-in / `.xll`, and not for a "test workbook", in addition to the `.xll`.

Unfortunately that is not a supported scenario in ExcelDna v1.0.0, because the build system will always reset the command-line arguments to the file name of the add-in specified. I've opened issue #238 to improve this story in a future version. You can subscribe to this issue to get notified of any progress in that area.

In the meantime, a workaround would be to disable the debugging feature, so that you can specify the test workbook file in the project properties, without it being rewritten on every build.

Inside of your Excel-DNA project, under `Properties`, there's a file called `ExcelDna.Build.props` which allows you to customize behaviors of the build system.

You can find an entry called `RunExcelDnaSetDebuggerOptions` there, and set it `false`.
To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+u...@googlegroups.com.

To post to this group, send email to exce...@googlegroups.com.
Visit this group at https://groups.google.com/group/exceldna.

Kirk Woodhouse

unread,
May 15, 2019, 8:00:16 AM5/15/19
to Excel-DNA
Good Morning Ciao,
Good to have confirmation on the approach you outlined  I had read a number of other posting and had just tested that as your post came in.

Another item of note:  I have a post build step to sign the .xll.  With V 1.0, I get a dialog complaining about a lack of signature.  Wondering if debug starts before the Post Build step.  And just to cover an obvious question, I have not adjusted/supplied Trusted Location.

For the benefit of anyone else who finds this thread in the future:  I did have to restart Visual Studio to get the change in `ExcelDna.Build.props` to take effect.  That or I messed something else up.  Point being if it does seem to work try a restart.

Kirk Woodhouse

unread,
May 15, 2019, 10:22:33 AM5/15/19
to Excel-DNA
Should have read:
For the benefit of anyone else who finds this thread in the future:  I did have to restart Visual Studio to get the change in `ExcelDna.Build.props` to take effect.  That or I messed something else up.  Point being if it does NOT seem to work try a restart.

Caio Proiete

unread,
May 15, 2019, 1:57:49 PM5/15/19
to exce...@googlegroups.com
Hi Kirk,

That's great that the workaround works for you!

Visual Studio usually requires a build, before you can debug, which would cause your post-event to run. Would it be possible that your post-build event is failing silently in some instances?
If you have a small sample that can reproduce that behavior, please send over as I'd be keen to take a look.
 
As for the changes in ExcelDna.Build.props, it's unfortunate that we need to restart Visual Studio due to caching. I did write a warning at the top of the file to let devs know about this possibility.

Thanks,
Caio Proiete
 

To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+u...@googlegroups.com.

To post to this group, send email to exce...@googlegroups.com.
Visit this group at https://groups.google.com/group/exceldna.

Kirk Woodhouse

unread,
May 16, 2019, 8:56:18 AM5/16/19
to Excel-DNA
Good Morning Caio,
With respect to the Post-Build event: While I haven't had time to prove this, I strongly believe the issue is that I am only signing the packed .xll.  It appears that Excel-DNA's debug conventional is to use the correct non-packed, appropriate bitness .xll.  Something I should do to in my solution to cover the bases.

Didn't want to waste your time running down a problem that is on my end.  Appreciate your time and support.

Thanks,
Kirk

Caio Proiete

unread,
May 18, 2019, 10:30:27 PM5/18/19
to exce...@googlegroups.com
Ah, perfect! That makes sense. Indeed, by default Excel-DNA v1.0 loads the most appropriate (32-bit or 64-bit) non-packed add-in into Excel when debugging, so if you are only signing the packed one, the warning is expected.

FWIW, this was a design decision to make the debugging experience faster - as the packed add-in is always slower to load than the native one (there's a cost in unpacking during load, of course...).
I also leave the signing of the add-in only for Release builds, for the same reason... I don't want to wait signing to complete before I can run locally on my machine... I only care about signing when building a version that will be deployed somewhere...
For that reason, I add my add-in folder to the "Trusted Locations" in Excel, in order to suppress the warning...


Thanks,
Caio Proiete


To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+u...@googlegroups.com.

To post to this group, send email to exce...@googlegroups.com.
Visit this group at https://groups.google.com/group/exceldna.
Reply all
Reply to author
Forward
0 new messages