开发者

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

开发者 https://www.devze.com 2023-02-01 00:21 出处:网络
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?

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
0

精彩评论

暂无评论...
验证码 换一张
取 消