ElectronNET/Electron.NET · error · BuildAbortedException
Could not parse version from release notes header.
Error message
Could not parse version from release notes header.
What it means
ParseComplexFormat reads a header line from the release notes and passes it to SemVersion.TryParse to extract the version. When the header line is not a valid semantic version string, the parser cannot build a ReleaseNotes entry and throws BuildAbortedException. This is the complex-format branch of the parser, reached via Parse.
Solutions
- Edit the release notes header line to contain a valid SemVer string exactly where the parser expects it (e.g. '1.2.3', optionally followed by description).
- Remove prefixes like 'v', 'Version', or markdown heading markers from the version line.
- Use full three-part versions (major.minor.patch) instead of '1.2'.
- Compare with a known-good historical revision of the CHANGELOG to restore the expected header format.
Example fix
// before (release notes header) ## v1.2.3 // after 1.2.3
Defensive patterns
Strategy: validation
Validate before calling
var header = lines.FirstOrDefault(l => !string.IsNullOrWhiteSpace(l));
if (!SemVersion.TryParse(header?.TrimStart('#', ' ', 'v'), out _))
throw new InvalidOperationException($"Release notes header '{header}' is not a valid semver."); Try / catch
try
{
var notes = parser.Parse(lines);
}
catch (BuildAbortedException ex) when (ex.Message.Contains("Could not parse version"))
{
Logger.Error("Fix the version header line in the release notes (use major.minor.patch, no 'v' prefix).");
} Prevention
- Always write headers as strict major.minor.patch without 'v' or heading markers.
- Validate the CHANGELOG with a regex/semver check in CI.
- Use a changelog generation tool that emits the parser's expected format.
- Review CHANGELOG diffs in PRs for accidental header edits.
When it happens
Trigger: A release notes file in complex format contains a header line (at the current lineIndex) that SemVersion.TryParse cannot parse — e.g. '1.2' or 'v1.2.3' or 'Version 1.2.3' instead of a strict '1.2.3' style version at the start of the line.
Common situations: Manually edited CHANGELOG where the version was prefixed with 'v' or a word; two-part version numbers (1.2) lacking the required components; heading markdown ('## 1.2.3') left on the version line; locale/full date accidentally placed where the version is expected.
Related errors
- Unknown release notes format.
- Expected property name.
- Unexpected end while reading property value.
- Unexpected end while reading object.
- Unexpected end while reading array.
AI-assisted analysis of ElectronNET/Electron.NET@87cc6f98b6 (2026-09-14).
Data as JSON: /api/errors/ad91de3cf0d18bed.
Report an issue: GitHub.
Appendix: source
Thrown at nuke/ReleaseNotesParser.cs:78
private IReadOnlyList<ReleaseNotes> ParseComplexFormat(string[] lines)
{
var lineIndex = 0;
var result = new List<ReleaseNotes>();
while (true)
{
if (lineIndex >= lines.Length)
{
break;
}
// Create release notes.
var semVer = SemVersion.Zero;
var version = SemVersion.TryParse(lines[lineIndex], out semVer);
if (!version)
{
throw new BuildAbortedException("Could not parse version from release notes header.");
}
var rawVersionLine = lines[lineIndex];
// Increase the line index.
lineIndex++;
// Parse content.
var notes = new List<string>();
while (true)
{
// Sanity checks.
if (lineIndex >= lines.Length)
{
break;
}
View on GitHub (pinned to 87cc6f98b6)