.NET, Visual Studio 2008, SVN - Reading version number at compile time?

Does anyone know if there is a way to access the solution / project version number from SVN and include it in the application code at compile time?

thanks

+8
version-control c # svn visual-studio
source share
2 answers

Disclaimer: I was a member of the project at the time of this writing. Although, I still recommend AutoBuildVersion.

Yes, AutobuildVersion and SVN PlugIn provide this functionality.

+8
source share

Assume your SVN version is the same as the project build version

System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Revision 

or, for some assembly that has sometype

 System.Reflection.Assembly.GetAssembly(typeof(SomeType)).GetName().Version.Revision 
0
source share

Source: https://habr.com/ru/post/650385/


All Articles