views:

52

answers:

1

There seem to be 2 classes that relates to workflow Activities in .NET 4: System.Workflow.ComponentModel.Activity and System.activities.Activity

What's the difference between the two?

+1  A: 

The first one is from Workflow Foundation 3.0 and the second one is for Workflow Foundation 4.0.

There was a substantial rewrite (for the better imho) between the two. 3.0 workflow activities can be used in 4.0 via migration or via interop.

Will
Thanks!Do you know what the equivalent of Activity.OnActivityExecutionContextLoad in WF4?
rgunawan
That would be the Activity.CacheMetadata() function.
Maurice
@rgunawan I don't think so, but it depends on what you use it for. WF 4.0 uses the NetDataContractSerializer which respects attributes such as the OnSerializingAttribute which can be applied to a method called during the serialization and deserialization process. Also, the NDCS doesn't have many of the limitations of other, previously used, serializers, so you may not need that method at all.
Will