1
votes

I am using TFS 2010 with TeamCity 8. Its a dot net solution.

I need three things.

1- Assemblies should be verisoned like this: 4.3.[tfs revision number].[counter].

(i.e. Assembly File Version and Assembly Product Version.)

2- The solution structure looks like this:

    Root folder -> solution.sln
    Root folder -> proj1 -> proj1.proj
    Root folder -> proj2 -> proj2.prj
    Root folder -> several other projects

Please note that proj1 is an asp.net web application and proj2 is a wcf service.

I want to create two zip files on the server \\myserver\teamcityartefact\proj1.zip and \\myserver\teamcityartefact\proj2.zip.

3- I also want to make sure that the release configuration is used to build the artefacts.

Is there any thorough walk-through you can recommend?

Settings: The build step settings are: Runner type: Visual Studio (sln). Solution file path: solution.sln. Visual Studio: Microsoft Visual Studio 2013. Targets: Clean;Rebuild;Publish; Configuration: Release.


What have I tried so far:

a. Artifact Paths: *.* => \\myserver\teamcityartefact\proj1.zip

But that creates four files in the zip file. solution.sln, solution.sln.metaproj, solution.sln.metaproj.tmp and solution.vssscc.

b. Artifact Paths: proj1\**\*.* => projA and proj2\**\*.* => projB returns me all the files in the projects. These are not pre-compiled published files. The build step settings are: Runner type: Visual Studio (sln). Solution file path: solution.sln. Visual Studio: Microsoft Visual Studio 2013. Targets: Clean;Rebuild;Publish; Configuration: Release.

c. proj1**\bin***.* => projA.zip returns me the contents of the bin folder. Its an asp.net application.

d. I am sure the release configuration is not being used as the webconfig is not transformed.

e.The build number format of assemblies in the bin folder at the moment is 1.0.0.0.

1
can you be more specific why alternative b. is not satifactory? How come you are uncertain that the Release configuration is used?Snorre
Thanks for the comment @Snorre. Although I get all the files but they are not pre-compiled. For example, all the .cs files (source files) are in the artefacts. I want the published version (i.e. only the dlls and .aspx files for pages).Oxon
And... The release configuration is not used because the webconfigs are not transformed.Oxon

1 Answers

5
votes

On step b, you'll need to filter the files more, because you're grabbing everything under the root of the project.

The easiest way to do that is to probably target your bin folder, so maybe...

proj1\**\bin\**\*.* => projA.zip

An alternative is add a new custom command build step to the end of your build config that handles zipping the files and puts them to the top of that build directory.

You then specify just the zip name in the Artifacts field, and that makes it available for download from Team City. Or, in your custom command, go ahead and deploy the zipped artifacts to your network share.