Workflow variable reset at Run On Agent
-
Tuesday, June 08, 2010 12:13 AM
I have customized my build process to determine a build version. This is used to rename the build number and to inject into the version files of the product so it is built against that version.
Once I have determined the version number in Sequence \ Update Drop Location, the BuildVersion is assigned to a variable scoped to Sequence. This value is then reset at Run On Agent and cannot be used when the source files are downloaded. I have added a debug message before the AgentScope activity and another debug message as the first child activity. Before the activity, the BuildVersion variable is populated with the expected values. The first child message identifies that this variable has been reset.
Here is part of the log surrounding the start of the Run On Agent activity.
If DropBuild And Build Reason is ValidateShelveset Initial Property Values Condition = False Final Property Values Condition = False BuildVersion: (4.3.3.10) 00:34 Run On Agent (reserved build agent TFS-BUILD01 - Agent1) Initial Property Values MaxExecutionTime = 00:00:00 MaxWaitTime = 04:00:00 ReservationSpec = Name=*, Tags= BuildVersion: (0.0.0.0) 00:00 Initialize Variables
Does anyone know why this is happening and how to avoid it?
Cheers
Answers
-
Tuesday, June 08, 2010 11:01 PM
Solved. The issue was the that original implementation of the build version information was a struct. I then added SerializableAttribute to the struct, then changed it to a class. Neither of these changes had any affect.
The issue seems to be that the items on the struct and class were fields which are not passed to the build agent. The entity needs to define properties rather than fields so that the data can be found and provided to the agent. The Serializable attribute was not required either.
- Marked As Answer by Rory_Primrose Tuesday, June 08, 2010 11:01 PM
All Replies
-
Tuesday, June 08, 2010 11:01 PM
Solved. The issue was the that original implementation of the build version information was a struct. I then added SerializableAttribute to the struct, then changed it to a class. Neither of these changes had any affect.
The issue seems to be that the items on the struct and class were fields which are not passed to the build agent. The entity needs to define properties rather than fields so that the data can be found and provided to the agent. The Serializable attribute was not required either.
- Marked As Answer by Rory_Primrose Tuesday, June 08, 2010 11:01 PM
-
Wednesday, June 09, 2010 1:23 AMModeratorI'm glad to hear this issue has been solved. Thanks for sharing.
Hongye Sun [MSFT]
MSDN Subscriber Support in Forum
If you have any feedback on our support, please contact msdnmg @ microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
See what's happening in MSDN forum? Follow us at Twitter.

