Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 283853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:24:31+00:00 2026-05-12T05:24:31+00:00

I am using TeamCity 4.5.1 to build and deploy an ASP.Net application to development.

  • 0

I am using TeamCity 4.5.1 to build and deploy an ASP.Net application to development.

This is working perfectly so far, however, my manager has asked that I tag the folder with the specific SVN Revision from which the source was compiled.

I am using an MSBuild script to do the build and deployment, however, I am unable to successfully retrieve the build number.

Here is the MSBuild command I’m using (sanitized):

<Exec Command="&gt;\\server08\D$\Websites\MYPROJECT\version.txt echo %env.BUILD_VCS_NUMBER%,%env.BUILD_VCS_NUMBER.1%,%system.build.vcs.number%,%system.build.vcs.number.1%,%system.build.number.format%,%system.build.number.format.1%,%system.build.vcs.number.MYPROJECT_Web_Root%,%env.TEAMCITY_VCS_NUMBER_MYPROJECT_Web_Root%" />

Version.txt turns up like this:

,,,,,,,,

Aka, empty. What am I doing wrong? Any better way to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T05:24:32+00:00Added an answer on May 12, 2026 at 5:24 am

    %env.XYZ% is TeamCity’s method of referring to the environment variables, if you want to use them in ITS settings anywhere.

    In a batch file or via msbuild, you only want the XYZ part.

    echo %BUILD_VCS_NUMBER% > \\path\to\version.txt
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using TeamCity Professional Version 4.5.4 (build 9071) at work to build my asp.net
I have a question about precompiling ASP.NET web application projects from TeamCity. This is
We were using TeamCity for our Build server, .Net Framework 4 and ASP.NET MVC2
I am trying to build and deploy a .NET 4 project using MSBuild Web
I am using TeamCity to build a .NET product. I'd like to take all
I'm pulling my hair out over this MSBuild issue. We're using TeamCity to build
I am trying to setup a .net build using Teamcity. We got it to
We recently added a new TeamCity build agent. Because it doesn't have ASP.NET MVC
I would like to integrate Cobertura into my Teamcity build. I'm using this link
I'm investigating build tools for use with an ASP.NET MVC 2 application. I like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.