Skip to content

Conversation

@Hamunii
Copy link

@Hamunii Hamunii commented Apr 7, 2025

Fixes #4 by checking if BepInEx is in references and the major version is 5, and if so, strips the build metadata from the informational version when setting version.

The reason the informational version is still used is that it matches more closely what was set as the <Version/>, such as 1.0.0 stays as 1.0.0 while the normal version would be 1.0.0.0 which BepInEx 5 does still like, but we want the version as we exactly set it, and how it has worked.

return (string?)attribute?.ConstructorArguments.Single().Value;
}

private static bool IsPreferStripInformationalVersionInfo(GeneratorExecutionContext context)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ShouldStripInformationalVersionSuffix is way easier to read.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generates invalid version number for BepInEx 5 (not tested on 6) with .NET SDK 8 or higher with default project configuration

2 participants