문제

I want to make a target in my MSBuild script that:

  • Fetch SVN revision/datetime from sources folder ('svn info' command)
  • Update VERSIONINFO resource from .EXEs and .DLLs generated by 'build' target

There is something ready to accomplish this? I'm asking just before reinvent another wheel...

I'm giving a look into http://msbuildextensionpack.codeplex.com

도움이 되었습니까?

해결책

MSBuild Community Tasks Project is your friend. Check their "SvnInfo" task.

Also, Daniel Doubrovkine's ResourceLib is an excellent piece of work and can avoid you lots of headaches when trying to untangle the VERSIONINFO creation mess (been there, done that...)

다른 팁

Much easier to do this before compilation by writing an AssemblyInfo file (or any file with assembly attributes) thats included in your projects.

Example of writing this in powershell found here: https://github.com/craigbeck/rhino-esb/blob/master/psake_ext.ps1#L7-46

One caveat -- the versions in .net are not just any string but ushorts which means they have a max of 65535 (see docs here). If you use the svn revision (as we did at one point) your build will break once it exceeds that magic number.

Why would you be trying to do this after compilation?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top