© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•8mo ago•
9 replies
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" />
    <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
StringOrNumber
:
[GenerateOneOf]
public partial class StringOrNumber : OneOfBase<string, int> { }
[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>)'
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!
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ PDF generation library?
C#CC# / help
4y ago
code not working
C#CC# / help
3y ago
❔ Optimize Compiler Code Generation
C#CC# / help
4y ago