C#C
C#6mo ago
yoush

✅ OneOf library code generation not working?

I'm trying to set up the https://github.com/mcintyre321/OneOf library. Wanted to try the class generator example, and installed that part as well as the base OneOf library
    <PackageReference Include="OneOf" Version="3.0.271" />
    <PackageReference Include="OneOf.SourceGenerator" Version="3.0.271" />

Running into an issue when trying to run the example code they listed https://github.com/mcintyre321/OneOf?tab=readme-ov-file#oneofbase-source-generation
the red squiggly is under StringOrNumber :
C#
[GenerateOneOf]
public partial class StringOrNumber : OneOfBase<string, int> { }

There is no argument given that corresponds to the required parameter 'input' of 'OneOfBase<string, int>.OneOfBase(OneOf<string, int>)'

new to source code generation related stuff and C#, help is appreciated, thank you!
Was this page helpful?