There is an error with dynamic elements and properties:
The problem is related to the impossibility of accessing the elements and properties created within the target object until the actual completion of the goal is completed
(More info here ).
The workaround is simple: use one goal to create the property.
<Target Name="Release"> <Message Text="Env: $(Env)"/> </Target> <Target Name="CreateProperty"> <CreateProperty Value="Development"> <Output TaskParameter="Value" PropertyName="Env" /> </CreateProperty> </Target> <Target Name="ReleaseIntegration" DependsOnTargets="CreateProperty"> <Message Text="Env: $(Env)"/> <CallTarget Targets="Release"/> </Target>
You'll get:
Env: Development Env: Development
source share