private static ActivityImplementationBase GetBackingClassInstanceForWfActivity(WfActivity activity) { var backingClassEntity = activity.IsOfType.Select(t => t.As <ActivityType>()).First(t => t != null); Class firstActivityBackingClass = backingClassEntity.ActivityExecutionClass; var s = typeof(LogActivityImplementation).FullName; var q = typeof(LogActivityImplementation).FullName; var typeString = string.Format("{0}, {1}", firstActivityBackingClass.TypeName, ClassHelper.CheckAssemblyName(firstActivityBackingClass.AssemblyName)); var activityType = Type.GetType(typeString, true); var activityInstance = (ActivityImplementationBase)Activator.CreateInstance(activityType); return(activityInstance); }