chuongmep/RevitAddInManager

Debug/Trace shows no output

sigtrygg-space opened this issue · 5 comments

Describe the bug
First of all, thank you for this great piece of software, it helps a lot!
Today, I wanted to test the Trace/Debug feature, which would be so very useful - but sadly it did not work...
For testing i copied your ColorWriteLine command (see screenshot) and it ran without any errors.
After running the command though, neither Listener-window nor Debug/Trace Output Dockpanel had any content.
Is there anything else I might be missing? Any idea as to why it won't log anything?

Expected behavior
As per my understanding, there should be 5 colored lines of text put out on the Debug/Trace Output and the Listener-window.

Screenshots
Screenshot

Desktop (please complete the following information):
OS: Windows 10 Pro
Revit-Version: 2023.0 (23.0.11.19)
AddInManager-Version: 1.3.5 (the latest version as of today => https://github.com/chuongmep/RevitAddInManager/releases/latest)
.NET-Version of my AddIn: 4.8

@sigtrygg-space Try test again, if still not working, please upload project to GitHub, I will help review .

I'll repair/reinstall the addin, copy your original Test.cs file to my project and try again from there on Monday.

Are there any known sources for an error like this? Any other addins that might pose a problem? Or maybe anything missing in my code? I'd really love to have this functionality

@sigtrygg-space I don't see any error in code, may be need check some config of project from your setting or check agian your computer.

hi @chuongmep
Thank you for your help!

I have been able to solve my problem with the help this StackOverflow answer about DEBUG and TRACE constants.
It's kind of a rookie mistake, I'll document it here in case anyone else encounters the same challenge - of course, DEBUG and TRACE constants need to be defined for this to work:

On Project Properties > Build:

  • Configuration: Debug
  • "Define DEBUG constant" is checked
  • "Define TRACE constant" is checked

Don't forget to load the Debug-Build in the AddInManager. Now, the "Listener" Tab within AddInManager showed the output - the Debug/Trace Dockpanel didn't work right away, but after a restart of Revit, it is now working all right.

Nice, happy coding.