tag:help.appveyor.com,2012-11-13:/discussions/questions/182-build-propertiesAppVeyor: Discussion 2016-05-09T18:14:03Ztag:help.appveyor.com,2012-11-13:Comment/298794122013-11-08T18:20:56Z2016-05-09T18:14:03ZBuild properties<div><p>Hi,</p>
<p>Is it possible to access the properties listed at "custom build
scripts" from a default .sln type of build?</p>
<p>We're using a custom msbuild script for versioning, and it'd be
nice to be able to access for example the build number.</p>
<p>Thanks,</p>
<p>a.</p></div>atag:help.appveyor.com,2012-11-13:Comment/298794122013-11-08T18:25:02Z2013-11-08T18:25:02ZBuild properties<div><p>Yes, the following variables are available during "Visual Studio
solution" and "MSBuild" builds:</p>
<ul>
<li>AppVeyor.ProjectName</li>
<li>AppVeyor.ProjectVersion</li>
<li>AppVeyor.ProjectBuildNumber</li>
<li>CommitId</li>
<li>RepositoryType</li>
<li>RepositoryName</li>
<li>RepositoryBranch</li>
</ul></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/298794122013-11-08T18:35:35Z2016-05-09T18:14:03ZBuild properties<div><p>How do I access them?</p>
<p>MSBuild properties cannot have dot in their names.</p>
<p>I have a TestVeyor project set up for this, build fails with</p>
<pre>
<code>error MSB4184: The expression """.ProjectName" cannot be evaluated. Method 'System.String.ProjectName' not found</code>
</pre></div>atag:help.appveyor.com,2012-11-13:Comment/298794122013-11-08T18:59:40Z2013-11-08T18:59:40ZBuild properties<div><p>Indeed, there is a problem with that in MSBuild.</p>
<p>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 <code>$(Appveyor_ProjectName)</code>.</p>
<p>Hope that helps. Let me know how that works for you.</p>
<p>Oh, another idea is to use inline MSBuild task written in C#
where you read environment variables using System.Environment class
:)<br>
<a href=
"http://msdn.microsoft.com/en-us/library/dd722601.aspx">http://msdn.microsoft.com/en-us/library/dd722601.aspx</a></p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/298794122013-11-08T19:47:07Z2016-05-09T18:14:03ZBuild properties<div><p>Right, I missed that they are env. variables as well.</p>
<p>Anyway, the underscore version is working perfectly now,
thanks!</p></div>atag:help.appveyor.com,2012-11-13:Comment/298794122013-11-08T19:48:31Z2013-11-08T19:48:31ZBuild properties<div><p>You're welcome!</p></div>Feodor Fitsner