When I try to open xaml file, the designer only shows a red box with "Could not generate view for Workflow"
Here's the steps I took:
- create a simple workflow in Dynamics CRM 2011
- add the workflow to a solution, and exported the solution as unmanaged.
- In Visual Studio 2010, create a .NET 4 Activity Library
- Right click on project, and add existing and select the xaml file exported in the solution
- Double click on the .xaml file to view it in designer
I have also added reference of microsoft.xrm.sdk.dll and microsoft.xrm.sdk.workflow.dll in my project.
Actual exception:
System.NullReferenceException: Object reference not set to an instance of an object.at Microsoft.Xrm.Sdk.Workflow.Activities.ReferenceLiteral`1.CacheMetadata(CodeActivityMetadata metadata)
at System.Activities.CodeActivity`1.OnInternalCacheMetadataExceptResult(Boolean createEmptyBindings)
at System.Activities.Activity`1.OnInternalCacheMetadata(Boolean createEmptyBindings)
at System.Activities.Activity.InternalCacheMetadata(Boolean createEmptyBindings, IList`1& validationErrors)
at System.Activities.ActivityUtilities.ProcessActivity(ChildActivity childActivity, ChildActivity& nextActivity, Stack`1& activitiesRemaining, ActivityCallStack parentChain, IList`1& validationErrors, ProcessActivityTreeOptions options, ProcessActivityCallback callback)
at System.Activities.ActivityUtilities.ProcessActivityTreeCore(ChildActivity currentActivity, ActivityCallStack parentChain, ProcessActivityTreeOptions options, ProcessActivityCallback callback, IList`1& validationErrors)
at System.Activities.ActivityUtilities.CacheRootMetadata(Activity activity, LocationReferenceEnvironment hostEnvironment, ProcessActivityTreeOptions options, ProcessActivityCallback callback, IList`1& validationErrors)
at System.Activities.Validation.ActivityValidationServices.InternalActivityValidationServices.InternalValidate()
at System.Activities.Validation.ActivityValidationServices.Validate(Activity toValidate, ValidationSettings settings)
at System.Activities.Presentation.Validation.ValidationService.CoreValidationWork(ValidationReason reason, CancellationToken cancellationToken)
d:\Projects\ActivityLibrary1\ActivityLibrary1\SendEmailProcess-5F3D855D-9B4D-4E3F-8DE0-09622D20E786.xaml
Any Idea??