Closed samaguire closed 5 months ago
NB: I noticed the missing ';' at the end of the last line in my code. I fixed for this, but the result is the same.
Hi @samaguire
We don't officially support the use of the #load
preprocessor directive, so this is not a bug per se. The reason that it works in scripts is that we use Roslyn's Scripting API, where as for macros, the code is compiled into a reusable module. The latter does not support the use of #load
. Moreover, it's not clear how changes made to the referenced .cs/.csx files, should cause recompilation of this module.
So for now, you'll have to find a workaround, such as copying the referenced code into your script before saving it as a macro. You'll also find that the #load
directive won't work at all in TE2.
We're happy to list this as a feature request, as we certainly see the benefit of being able to reuse code this way, but it'll have to be prioritized among the other items in our backlog.
Description
I've created a simple csx (C# script) file which contains a single class. I can load the csx file and utilise the class, however, I get an error (without details) when I try to save the macro.
TE3 Macro
C# Script
Tabular Editor 3 Version
3.12.0
Screenshots
Steps to Reproduce
No response
Expected behavior
The macro saves and can be used again in the future
Crash Report
No response
Windows Version
Windows 10 Pro (22H2)