If I look at the interface of TFS-server, under category "build & release", I can see the build number:
I want to know how can I get access to the value of the last build: 23112017-8 in my WPF application (I want to display in my WPF app - "Last Build: 23112017-8"). How can I get this value via C# code, for example in my view model?
Try this :
The value returned from
Assembly.GetExecutingAssembly().GetName().Version
is that in your project'sAssemblyInfo.cs
file:You can use the extension Update AssemblyInfo to modify the version as build number before a build to specify the value it returns.
Just use the predefined variable
Build.BuildNumber
to get the build number.Reference :