Assembly Versioning with TeamCity

后端 未结 4 1760
广开言路
广开言路 2020-12-24 02:58

I\'m working on a C#/VB.Net project that uses SVN and TeamCity build server. A dozen or so assemblies are produced by the build. I want to control the assembly versions so t

4条回答
  •  悲&欢浪女
    2020-12-24 03:34

    I'd suggest using TeamCity's AssemblyInfo patcher build feature:

    http://confluence.jetbrains.net/display/TCD65/AssemblyInfo+Patcher

    Just create your projects from VisualStudio, configure the build feature in the BuildSteps page (see http://confluence.jetbrains.net/display/TCD65/Adding+Build+Features), and as long as you keep the default AssemblyInfo.cs file, it will work.

    This approach is working great for me.

    Advantages:

    • Developers can build the solution in their machines.
    • You don't need to touch the .sln or .csproj files. It just works.
    • By using TeamCity variables you can easily make the version number match some other project's version, etc.

    Disadvantages:

    • You can't easily switch to another CI server from TeamCity because you don't have a build script (but switching CI servers is like switching ORM or database: it is very unlikely and will require a lot of work anyway).

提交回复
热议问题