Add NuGet package version to ThisAssembly
See original GitHub issueI’m working on a .NET tool which will add a reference to a NuGet package to a project file, very similar to what nbgv
does.
For this, I’d like to use a property on ThisAssembly
which would return the NuGet package version.
@AArnott what do you think?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:14
Top Results From Across the Web
ThisAssembly 1.4.0
dotnet add package ThisAssembly --version 1.4.0. NuGet\Install-Package ThisAssembly -Version 1.4.0. This command is intended to be used within the Package ...
Read more >ThisAssembly 1.2.10
Meta-package that includes all ThisAssembly.* packages. ... See the version list below for details. ... dotnet add package ThisAssembly --version 1.2.10.
Read more >ThisAssembly 1.2.11
Meta-package that includes all ThisAssembly.* packages. ... See the version list below for details. ... dotnet add package ThisAssembly --version 1.2.11.
Read more >ThisAssembly 1.1.1-beta
This is a prerelease version of ThisAssembly. There is a newer version of this package available. See the version list below for details....
Read more >ThisAssembly 1.0.6
Meta-package that includes all ThisAssembly. ... There is a newer version of this package available. ... dotnet add package ThisAssembly --version 1.0.6.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Really? What compare method would you use? You’d need to know whether the version string is using semver1 or 2 rules then use a compare function appropriate for that semver syntax. It wouldn’t be a simple
Version
class comparer. Would you redist a NuGet assembly and use its comparer function?That would have very specific build ordering requirements. But it should be possible. Like this:
correct, using Nuget.Versioning to provide SemVer-compatible version comparison, to enable auto-update for the application itself, and (future plan) application content, aside using Nuget Core/Protocolto handle feed, download and unpacking. All worked well from the ground for public releases, just got stuck when offering an additional update channel for “developer versions” which are basically non-public releases in nbgv semantic (and served of a separate feed). Certainly not a standard use case.
aweseome just did a quick test and seems to do that I needed, saves me from string-mangeling metadata into release labels for non-public releases. Thanks for quick response, and great tool!