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

3 comments
Comment actions Permalink

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.

0
Comment actions Permalink

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

0
Comment actions Permalink

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.

0

Please sign in to leave a comment.