.NET, Visual Studio 2008, SVN - Reading revision number at compile time?
Does any one know if there is a way to access a solution/project's revision number from SVN and incorporate this in application code at compi开发者_如何学JAVAle time?
Thanks
Disclaimer: I was a member of the project at the time of writing this. Though, I still recommend AutoBuildVersion.
Yes, AutobuildVersion does together with the SVN PlugIn provide such a functionality.
Supposing your SVN version is the same as project assembly version
System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Revision
or, for some assembly which has Sometype
System.Reflection.Assembly.GetAssembly(typeof(SomeType)).GetName().Version.Revision
精彩评论