Build properties
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.
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
Support Staff 1 Posted by Feodor Fitsner on 08 Nov, 2013 06:25 PM
Yes, the following variables are available during "Visual Studio solution" and "MSBuild" builds:
2 Posted by a on 08 Nov, 2013 06:35 PM
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
Support Staff 3 Posted by Feodor Fitsner on 08 Nov, 2013 06:59 PM
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 Posted by a on 08 Nov, 2013 07:47 PM
Right, I missed that they are env. variables as well.
Anyway, the underscore version is working perfectly now, thanks!
Support Staff 5 Posted by Feodor Fitsner on 08 Nov, 2013 07:48 PM
You're welcome!
Feodor Fitsner closed this discussion on 08 Nov, 2013 07:48 PM.