Asp.Net 5 Semantic Versioning
It seems that versioning works differently than in previous versions of .Net. The project.json seems to use semantic versioning (from what I have seen online) with the format Major.Minor.Patch-Special.
I wouldn't say that versioning has changed in a particularly dramatic way. In a version number xyz, the "x" means "big changes / breaking changes," the "y" means "minor additions and fixes," and the "z" means "very minor fixes." That's pretty close to what Semantic Versioning (SemVer) states.
In a project.json
-based project, there is only one place to specify the version, and that's in the project.json
file itself. That one version is a SemVer (eg xyz-prerel
) and is used for the NuGet package version and the assembly version, and the assembly informational version. If you've explicitly set the assembly version or informational version in the assembly, those will be respected and not overridden. (You can see the code here.)
At runtime you can read the assembly version through reflection (just like you always could).
When running in a DNX application there's also an ILibraryManager
interface that you can use to inspect the running application. However, that's a fairly advanced scenario.
Lastly, in the project.json
file you can hard-code the xyz part of the version, eg 1.2.3
but you can also specify a *
for the pre-release specifier, eg 1.2.3-*
. If you use *
for the pre-release specifier, you can set an environment variable named DNX_BUILD_VERSION
to specify the value of the *
, eg beta1
or rc2-54289
.
There are some feature requests logged to allow more flexibility in specifying the entire version number externally.
链接地址: http://www.djcxy.com/p/28014.html下一篇: Asp.Net 5语义版本控制