Is there any way to read extension version number from within the extension?
We are manually adding version to vss-extension.json and task.json . It will be great help if someone provide guidelines to retrieve version from either of these places.
2) task.json
You could use Build and Release tasks for Extensions which released by Microsoft.
This extension provides build and release tasks for packaging and publishing Visual Studio Team Services (VSTS) extensions to the Visual Studio Marketplace.
Use the query version task: query an extension's version (to make it easy to increment on your next package or publish)
For how to do this, you could refer the source code in GitHub.