Skip to content

New-GeneratedVersionProps.ps1 has invalid diagnostics #95

@smaillet

Description

@smaillet

Description:
The New-GeneratedVersionProps.ps1 contains code marked with a #<Diagnostic> comment and writing to the Verbose stream that is invalid. It's not clear what such reporting was for but if the script is run it fails on these. They are not needed as the generated file contains the information and is validatable.

Steps to reproduce the problem:

  • Reviewed the documentation.
  • Included Sample code or link to repository/gist to reproduce the bug (This is the fastest way to a resolution as it reduces the time to reproduce the problem. The smaller the sample is the better.)

Expected Behavior
No errors and the props file is generated

Actual Behavior
Failure

InvalidOperation: C:\Users\<%USERNAME%>\source\repos\CSemVer.GitBuild\New-GeneratedVersionProps.ps1:371
Line |
 371 |  … rsion.ToString($true): $($csemVer.PreReleaseVersion.ToString($true))"
     |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | You cannot call a method on a null-valued expression.

Not every version will have a pre-release version so this can fail if that does not exist.

Additional context
Breaks formal release builds without any pre-release information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugReported as a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions