question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting the version (patch) incremented prior to build/publish

See original GitHub issue

From @GuardRex on November 26, 2015 20:39

The version that matches what we’ll see in VS published output matches the version in project.json, so starting with …

"version": "1.0.9"

… will lead to folder named 1.0.9 in <output_folder>/approot/packages/<project_package>.

If I establish a PS script that would modify the project.json version and run that script in prepare or build

"scripts": {
  "prepare": [ "powershell.exe -ExecutionPolicy ByPass -file %project:Directory%/net5-autoupdate-version.ps1" ]
},

… it does increment the version in project.json, but it does so after the build/publish. The version showing in project.json at that point is always one patch number higher than the actual version in the package that I’m publishing. I have the same outcome if I try to hook the script in the vsweb-publish script prior to the Publish-AspNet command.

Is there a way to (or a tip to) auto-increment the project version (patch) when publishing, preferably with a version (patch) number in project.json that matches the package version (patch) in the output folder?

Copied from original issue: aspnet/dnx#3209

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

20reactions
RehanSaeedcommented, May 21, 2016

NPM has the version command which lets you bump up each number. Having the same for dotnet would be great.

0reactions
TheRealPiotrPcommented, May 20, 2016

@PhilipDaniels that sounds interesting. Can you take a look at http://dotnet.github.io/docs/core-concepts/core-sdk/cli/extensibility.html? It would be great to have these tools available as dotnet extensions!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Auto-incrementing package versions during npm publish
One of the ways to do it by using REST API magic. In this example, let's assume that your build number format looks...
Read more >
Can I automatically increment the file build version when ...
Go to Project | Properties and then Assembly Information and then Assembly Version and put an * in the last or the second-to-last...
Read more >
Setup version increment and automated release process
We have to create a script which manages VERSION file with functions: get version, get version with placeholder, increment version major/minor/ ...
Read more >
Incrementing version - During development? or after ...
I have a system which is live, lets call it version 1.0.x.x I'm using Major.Minor.Build.Revision Microsoft style versioning. I get a customer ...
Read more >
Updating your published package version number
Go to your package page ( https://npmjs.com/package/<package> ) to check that the package version has been updated. For more information on npm version...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found