Reading System property in build runner from C#
Is there a way to read System properties (like teamcity.dotnet.nunitaddin) in a build runner from C#?
I don't want to configure a environment variables for every build configuration explicitly.
Best regards,
forki
Please sign in to leave a comment.
Forki,
System property (system.<property name>) are passed to the build as system properties of the build script. Prefix system. should be trimmed from the properties before passing them into the build script.
Description of NUnit addins support can be found here: http://www.jetbrains.net/confluence/display/TCD5/NUnit+Addins+Support
BTW, depending of build runner type you are using the system property should be referenced differently http://www.jetbrains.net/confluence/display/TCD5/Using+Properties#UsingProperties-UsingPropertiesinthebuild.
Hi,
thanks a lot, but I'm using my own build runner which is started via "Console runner".
I'm interested how NAnt and MSBuild are getting these properties. Maybe I can add this as a new feature for my build runner.
Regards,
forki
You can add a reference to required property to command line of console runner: %system.prop.name%
Agent will replace reference with actual value when build starts.