I've been using Ant for years and have always used the following way to pass properties from my build.xml files to my Java programs:
<sysproperty key="my.property" value="${my.property}" />
In Java, I can access this property by:
System.getProperty("my.property");
I want to do the exact same thing but using NAnt and C#. I've tried doing this in NAnt:
<property name="sys.env.my.property" value="my.property.value"/>
<sysinfo verbose="true"/>
And then this in C#:
Environment.GetEnvironmentVariable("sys.env.my.property"); //doesn't work
Environment.GetEnvironmentVariable("my.property"); //doesn't work either
How can you access properties that are set in a build file, from a C# program?
Thanks for any help.
Misha
