Build properties

a's Avatar

a

08 Nov, 2013 06:20 PM

Hi,

Is it possible to access the properties listed at "custom build scripts" from a default .sln type of build?

We're using a custom msbuild script for versioning, and it'd be nice to be able to access for example the build number.

Thanks,

a.

  1. Support Staff 1 Posted by Feodor Fitsner on 08 Nov, 2013 06:25 PM

    Feodor Fitsner's Avatar

    Yes, the following variables are available during "Visual Studio solution" and "MSBuild" builds:

    • AppVeyor.ProjectName
    • AppVeyor.ProjectVersion
    • AppVeyor.ProjectBuildNumber
    • CommitId
    • RepositoryType
    • RepositoryName
    • RepositoryBranch
  2. 2 Posted by a on 08 Nov, 2013 06:35 PM

    a's Avatar

    How do I access them?

    MSBuild properties cannot have dot in their names.

    I have a TestVeyor project set up for this, build fails with

        error MSB4184: The expression """.ProjectName" cannot be evaluated. Method 'System.String.ProjectName' not found

  3. Support Staff 3 Posted by Feodor Fitsner on 08 Nov, 2013 06:59 PM

    Feodor Fitsner's Avatar

    Indeed, there is a problem with that in MSBuild.

    We've just pushed an update on build servers which allows you to use counterparts of those variables with underscore (_) instead of dot, for example $(Appveyor_ProjectName).

    Hope that helps. Let me know how that works for you.

    Oh, another idea is to use inline MSBuild task written in C# where you read environment variables using System.Environment class :)
    http://msdn.microsoft.com/en-us/library/dd722601.aspx

  4. 4 Posted by a on 08 Nov, 2013 07:47 PM

    a's Avatar

    Right, I missed that they are env. variables as well.

    Anyway, the underscore version is working perfectly now, thanks!

  5. Support Staff 5 Posted by Feodor Fitsner on 08 Nov, 2013 07:48 PM

    Feodor Fitsner's Avatar

    You're welcome!

  6. Feodor Fitsner closed this discussion on 08 Nov, 2013 07:48 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

 

26 Sep, 2024 03:49 PM
26 Sep, 2024 09:02 AM
25 Sep, 2024 07:07 PM
24 Sep, 2024 08:39 PM
24 Sep, 2024 06:47 AM
20 Sep, 2024 05:50 PM