DotEnvReaderOptions Struct
Definition
Provides configuration for a Utf8DotEnvReader, controlling how the reader interprets optional DotEnv syntax conventions.
public readonly struct DotEnvReaderOptions
- Inherited Members
- Extension Methods
Remarks
The options are an immutable value type; assign the init-only properties through an object initializer and read Default for the standard behaviour.
Properties
Default
Gets the default reader options: the export prefix, inline comments, and comment preservation are all
enabled.
public static DotEnvReaderOptions Default { get; }
Property Value
- DotEnvReaderOptions
The default options.
DisallowExportPrefix
Gets a value indicating whether a leading export keyword before a key is recognized and stripped.
public bool DisallowExportPrefix { get; init; }
Property Value
Remarks
The property is inverted so the parameterless Default enables the prefix.
DisallowInlineComments
Gets a value indicating whether a # preceded by whitespace terminates an unquoted value as an inline
comment.
public bool DisallowInlineComments { get; init; }
Property Value
Remarks
The property is inverted so the parameterless Default enables inline comments.
SkipComments
Gets a value indicating whether comment lines are surfaced as Comment tokens.
public bool SkipComments { get; init; }
Property Value
Remarks
The property is inverted so the parameterless Default preserves comments.
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |