DependencyVersionRangeToString Method

Overload List

ToStringReturns a string that represents the current object.
ToString(Int32, Boolean)

Returns string representation of DependencyVersionRange using the specified number of significant version parts and with optional simplification.

The significantVersionParts argument is handled in the following way:

significantVersionPartsBehavior
0Version part is written unless its value is Empty.
1 - 4 Trailing zeros are added to the resulting string if the actual number of version parts is less than significantVersionParts. If all part values after significantVersionParts are zeros then they are not added to the output. The output is not affected when IsPattern is .

When the simplify argument is the resulting string is simplified in the following way:

Full StringSimplified String
[*, )*
[<expr, expr>][<expr>]

  Tip

Call this method with significantVersionParts = 3 and simplify = to get the default string representation of the version range in NuGet.

See Also