Skip to content

.Net8 - error CS8669: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. #591

@kcalderon37

Description

@kcalderon37

Hi,

I'm getting an error once I build my project. Right now I'm using .Net8.

The complete error is like:

"error CS8669: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source"

Checking how to fix this, for now just found to change the .csproj file ,adding "< Nullable>enable< /Nullable >"

But, adding this to the .csproj causes lot of other errors.

Checking the "JsonElementExtensions" that is generated from Scriban, I can see this line:

" internal static object? ToScriban(this JsonElement model)"

and it looks there is the issue. Is there a workaround with this problem? or a close fix?

Thanks @xoofx

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions