I would like to use a C# code generator for a polyglot notebook. (My eventual goal is to generate a strongly typed object model from a CSV or excel file I wish to analyze.) In an initial test I created a new notebook and put this in the first cell
using System.Text.RegularExpressions;
public partial class Holder
{
[GeneratedRegex("A*b+")]
public partial Regex AbFinder();
}
I expected this to compile correctly and generate the implementation of AbFinder instead I get an error message:
Error: (6,26): error CS8795: Partial method 'Holder.AbFinder()' must have an implementation part because it has accessibility modifiers.
The error message makes me believe that either the code generator never ran, or the resulting code never got added to the compilation as the GeneratedRegex
attribute should have invoked a generator to implement the partial method AbFinder
.
Am I doing something wrong?