2015-12-22

NullReferenceException When Clicking a Task in Workflow Designer

The other day I was designing a Workflow (Workflow Manager technology) in Visual Studio 2012 when I stumbled upon on an exception when clicking on a SingleTask activity in Workflow Designer within Visual Studio. When I first click on a task I get "Communicating with SharePoint" dialog:


After Visual Studio establishes communication with SharePoint I end up with the following dialog:

Full exception stack trace is as follows:
-------------------------
Workflow Designer
-------------------------
NullReferenceException:
Object reference not set to an instance of an object.
-------------------------

Server stack trace:
   at Microsoft.VisualStudio.SharePoint.Designers.List.ModelAccess.SharePointSolutionModelStorage.GetAllFiles(ISharePointProject project)
   at Microsoft.VisualStudio.SharePoint.Designers.List.ModelAccess.SharePointSolutionModelStorage.Refresh(ISharePointProject project)
   at Microsoft.VisualStudio.SharePoint.Designers.List.ModelAccess.SharePointCompositeModelStorage.RefreshProjectModels()
   at Microsoft.VisualStudio.SharePoint.WorkflowDesignerSupport.ListInfoService.GetContentTypes(String BaseTypeId)
   at Microsoft.VisualStudio.SharePoint.WorkflowExtensions.SharePointListService.<GetWorkflowTaskContentTypes>b__10(IListInfoService service)
   at Microsoft.VisualStudio.SharePoint.WorkflowExtensions.SharePointListService.ConvertValues(Func`2 producer)
   at Microsoft.VisualStudio.SharePoint.WorkflowExtensions.SharePointListService.GetWorkflowTaskContentTypes()
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.SharePoint.DesignTime.Activities.Design.Services.ISharePointListService.GetWorkflowTaskContentTypes()
   at Microsoft.SharePoint.DesignTime.Activities.Design.ContentTypesProvider.ProvideItems(ISharePointListService service)
   at Microsoft.SharePoint.DesignTime.Activities.Design.IndependentDataProvider`1.GetItems(ModelItem owner, PropertyValue propertyValue)
   at Microsoft.SharePoint.DesignTime.Activities.Design.SharePointItemChooserViewModel`1.GetItems(ModelItem Owner, PropertyValue PropertyValue)
   at Microsoft.SharePoint.DesignTime.Activities.Design.ChooserViewModel`1.PopulateItems()
   at Microsoft.SharePoint.DesignTime.Activities.Design.GenericChooser`2.SharePointBaseChooser_Loaded(Object sender, RoutedEventArgs e)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.RouteItem.InvokeHandler(RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.EventRoute.InvokeHandlers(Object source, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
   at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
   at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
   at MS.Internal.LoadedOrUnloadedOperation.DoWork()
   at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
-------------------------


After a long debugging session of Workflow Designer I realized that my colleague accidentally deleted Package folder from SharePoint App project. I pulled the latest version and I didn't notice that folder was missing. When I restored the folder, Workflow Designer didn't throw any exceptions any more.

2015-12-03

Running a Project with Workflow in Provider-Hosted Add-In

While trying to run (F5 in Visual Studio) add-in project of provider-hosted add-in containing workflow I got this error in output window:

Microsoft.SharePoint.WorkflowServices
System.FormatException: RestrictAssociationToId   
 at Microsoft.SharePoint.WorkflowServices.DGWorkflowDeploymentProvider.PublishOrUpdateDefinitions(WorkflowServicesManager proxy, WorkflowDeploymentService deploymentService, Dictionary`2 oldDefinitionIdMap, Dictionary`2 newDefinitionIdMap, Dictionary`2 listIdDictionary)   
 at Microsoft.SharePoint.WorkflowServices.DGWorkflowDeploymentProvider.DeployOrUpgrade(WorkflowScopeIdentifier scopeId, SPWorkflowPart oldParts, SPWorkflowPart newParts, Dictionary`2 listIdDictionary)   
 at Microsoft.SharePoint.WorkflowServices.DGWorkflowDeploymentProvider.Deploy(WorkflowScopeIdentifier scopeId, SPWorkflowPart parts, Dictionary`2 listIdDictionary) StackTrace:
 at Microsoft.Office.Server.Native.dll: (sig=678c0f87-966f-4d99-9c94-b49e788d2672|2|microsoft.office.server.native.pdb, offset=131CE)
 at Microsoft.Office.Server.Native.dll: (offset=21BE5)


Turns out I didn't include target list and history list in the app feature. This caused aforementioned error while trying to deploy workflow during "Activate features" stage. As soon as I included the lists in the feature everything went ok.

2015-10-06

2015-09-09

Updating Workflow Definitions Without Terminating Current Instances

I haven't seen anywhere a good tutorial on how to update a workflow definition without terminating currently running instances on SharePoint 2013 Workflow Manager platform so this post is my contribution to the community. The goal of this post is to enable the following series of steps:
  1. Update workflow definition XAMLs (for example from version 1 to version 2).
  2. Allow currently running instances of workflow to finish running the version 1 of the workflow.
  3. New instances of workflow will run version 2 of the workflow. Version 1 of the workflow shouldn't be allowed to run any more.
Let's suppose you've created an empty SharePoint project in Visual Studio and you add a workflow to it. This workflow consists of one SingleTask activity. You run your workflow which consists of single task activity and now your workflow instance is blocking and waiting for this task to end. Now, let's suppose you add WriteToHistory activity to your workflow in Visual Studio. You leave workflow property Deployment Conflict Resolution on Automatic value and deploy your new version of the workflow using Visual Studio. You will see that running instance of the workflow gets terminated. If you change Deployment Conflict Resolution to None workflow definition will not get updated. If you try to deploy your WSP using PowerShell scripts (Add-SPSolution, Install-SPSolution, Enable-SPFeature, ...) the result will be the same, i.e. workflow definition will not get updated.

There are some examples on how to update Workflow Manager workflows on MSDN but these examples are strictly tied to Workflow Manager platform, not Workflow Manager in combination with SharePoint 2013. My solution is based on aforementioned MSDN article but it is adapted to SharePoint 2013.

Prerequisite for my solution is at least one deploy of the workflow using either Visual Studio deploy or using PowerShell scripts. Workflow needs to be deployed as a part of the feature only first time.

For part 1 of this post I will demonstrate how to publish new versions of workflow using console application. I also presume you are developing on development box with Visual Studio installed. In part 2 I will focus on packaging the deployment in feature receiver.
  1. Create new console application (.NET 4.5) project
  2. Add the following references to the project (not all are needed, but I didn't filter out unneeded references):
  3. Add WorkflowManagementClientExtensions class to the project:
    //------------------------------------------------------------
    // Copyright (c) Microsoft Corporation.  All rights reserved.
    //------------------------------------------------------------
    
    using Microsoft.Activities;
    using Microsoft.Activities.Messaging;
    using Microsoft.Workflow.Client;
    using System;
    using System.Collections.Generic;
    using System.Collections.ObjectModel;
    using System.Linq;
    using System.Threading;
    
    namespace Microsoft.Workflow.Samples.Common
    {
        public static class WorkflowManagementClientExtensions
        {
            public static void PublishActivity(this WorkflowManagementClient client, string name, string xamlFilePath)
            {
                client.Activities.Publish(
                    new ActivityDescription(WorkflowUtils.Translate(xamlFilePath))
                    {
                        Name = name
                    });
            }
    
            public static void PublishWorkflow(this WorkflowManagementClient client, string workflowName, string xamlFilePath, SubscriptionFilter activationFilter = null)
            {
                PublishWorkflow(client, workflowName, xamlFilePath, null, null, activationFilter);
            }
    
            public static void PublishWorkflow(this WorkflowManagementClient client, string workflowName, string xamlFilePath, Collection<ExternalVariable> externalVariables, SubscriptionFilter activationFilter = null)
            {
                PublishWorkflow(client, workflowName, xamlFilePath, externalVariables, null, activationFilter);
            }
    
            public static void PublishWorkflow(this WorkflowManagementClient client, string workflowName, string xamlFilePath, IDictionary<string, string> configValues, SubscriptionFilter activationFilter = null)
            {
                PublishWorkflow(client, workflowName, xamlFilePath, null, configValues, activationFilter);
            }
    
            public static void PublishWorkflow(this WorkflowManagementClient client, string workflowName, string xamlFilePath, Collection<ExternalVariable> externalVariables, IDictionary<string, string> configValues, SubscriptionFilter activationFilter = null)
            {
                // publish the activity description related with the workflow
                client.Activities.Publish(
                    new ActivityDescription(WorkflowUtils.Translate(xamlFilePath)) { Name = workflowName });
    
                // now, publish the workflow description
                WorkflowDescription description = new WorkflowDescription
                {
                    Name = workflowName,
                    ActivityPath = workflowName,
                };
    
                // add external variables
                if (externalVariables != null)
                {
                    externalVariables
                        .ToList()
                        .ForEach(ev => description.ExternalVariables.Add(ev));
                }
    
                // add config
                if (configValues != null)
                {
                    description.Configuration = new WorkflowConfiguration();
                    configValues
                        .ToList()
                        .ForEach(c => description.Configuration.AppSettings.Add(c));
                }
    
                // add activation filter
                if (activationFilter != null)
                {
                    description.ActivationDescription = new SubscriptionActivationDescription
                    {
                        Filter = activationFilter
                    };
                }
    
                // publish!
                client.Workflows.Publish(description);
            }
    
            public static void CleanUp(this WorkflowManagementClient client)
            {
                client.CurrentScope.Delete();
            }
    
            public static string WaitForWorkflowCompletion(this WorkflowManagementClient client, string workflowName, string instanceId, int pollingInterval = 0)
            {
                string currentStatus = string.Empty;
                string lastStatus = string.Empty;
    
                WorkflowInstanceInfo instanceInfo = client.Instances.Get(workflowName, instanceId);
    
                while (true)
                {
                    instanceInfo = client.Instances.Get(workflowName, instanceId);
    
                    currentStatus = instanceInfo.UserStatus;
    
                    if (currentStatus != lastStatus && !string.IsNullOrWhiteSpace(currentStatus))
                    {
                        Console.Write("   Current Status: ");
                        WorkflowUtils.Print(currentStatus, ConsoleColor.Cyan);
                        lastStatus = currentStatus;
                    }
    
                    if (instanceInfo.WorkflowStatus == WorkflowInstanceStatus.Started || instanceInfo.WorkflowStatus == WorkflowInstanceStatus.NotStarted)
                    {
                        Thread.Sleep(pollingInterval);
                        continue;
                    }
    
                    if (instanceInfo.WorkflowStatus == WorkflowInstanceStatus.Completed)
                    {
                        Console.WriteLine("\nWorkflow instance completed");
                    }
    
                    break;
                }
    
                return instanceInfo.UserStatus;
            }
        }
    } 
  4. Add WorkflowUtils class to the project. Notice that Translate method is loading assembly from Visual Studio PublicAssemblies folder:
    //------------------------------------------------------------
    // Copyright (c) Microsoft Corporation.  All rights reserved.
    //------------------------------------------------------------
    
    using System;
    using System.Text;
    using System.Xaml;
    using System.Xml;
    using System.Xml.Linq;
    using Microsoft.Activities.Design.ExpressionTranslation;
    using Microsoft.Workflow.Client;
    using System.Reflection;
    
    namespace Microsoft.Workflow.Samples.Common
    {
        public class WorkflowUtils
        {
            public static WorkflowManagementClient CreateForSample(string rootScope, string scopeName)
            {
                var rootClient = new WorkflowManagementClient(new Uri(rootScope));
    
                return rootClient.CurrentScope.PublishChildScope(scopeName,
                    new ScopeDescription()
                    {
                        UserComments = string.Format("For {0} sample only", scopeName)
                    });
            }
    
            public static XElement Translate(string xamlFile)
            {
                string translatedWorkflowString = null;
    
                Assembly wfAssembly = Assembly.LoadFile(@"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PublicAssemblies\Microsoft.SharePoint.DesignTime.Activities.dll");
                XamlXmlReaderSettings settings = new XamlXmlReaderSettings();
                settings.LocalAssembly = wfAssembly;
    
                using (XamlReader xamlReader = new XamlXmlReader(xamlFile, settings))
                {
                    TranslationResults result = ExpressionTranslator.Translate(xamlReader);
                    if (result.Errors.Count == 0)
                    {
                        StringBuilder sb = new StringBuilder();
                        using (XmlWriter xmlWriter = XmlWriter.Create(sb, new XmlWriterSettings { Indent = true, OmitXmlDeclaration = true }))
                        {
                            using (XamlXmlWriter writer = new XamlXmlWriter(xmlWriter, result.Output.SchemaContext))
                            {
                                XamlServices.Transform(result.Output, writer);
                            }
                        }
                        translatedWorkflowString = sb.ToString();
                    }
                    else
                    {
                        throw new InvalidOperationException("Translation errors");
                    }
                }
    
                return XElement.Parse(translatedWorkflowString);
            }
    
            public static void PrintDone()
            {
                Print("[Done]", ConsoleColor.Green);
            }
    
            public static void Print(string message, ConsoleColor color)
            {
                ConsoleColor currentColor = Console.ForegroundColor;
                Console.ForegroundColor = color;
                Console.WriteLine(message);
                Console.ForegroundColor = currentColor;
            }
        }
    }
  5. Now you need to find out the GUID of the module which was used in deploying workflow (prerequisite). This GUID is located in the Module element, Url attribute in Elements.xml file in workflow folder. For example, in Elements.xml file:
    <?xml version="1.0" encoding="utf-8" ?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
      <Module Name="Workflow1" Url="wfsvc/86c7e42d4fe14b839d55fcbb6dde7b9c">
        <File Url="Workflow.xaml" Type="GhostableInLibrary" Path="Workflow1\Workflow.xaml" DoGUIDFixUp="TRUE">
          <Property Name="ContentType" Value="WorkflowServiceDefinition" />
          <Property Name="isReusable" Value="true" />
          <Property Name="RequiresInitiationForm" Value="False" />
          <Property Name="RequiresAssociationForm" Value="False" />
          <Property Name="WSPublishState" Value="3" />
          <Property Name="WSDisplayName" Value="Workflow1" />
          <Property Name="WSDescription" Value="My 'Workflow1' Workflow" />
          <!-- If you change the name or Url of your custom initiation or association form, 
               remember to update the corresponding property value (InitiationUrl or AssociationUrl) to match the new web relative url.
          -->
          <Property Name="RestrictToType" Value="List" />
          <Property Name="RestrictToScope" Value="{$ListId:Shared Documents;}" />
        </File>
        <File Url="WorkflowStartAssociation" Path="Workflow1\WorkflowStartAssociation" Type="GhostableInLibrary">
          <Property Name="WSDisplayName" Value="Workflow1 - Workflow Start" />
          <Property Name="ContentType" Value="WorkflowServiceSubscription" />
          <Property Name="WSPublishState" Value="3" />
          <Property Name="WSEventType" Value="WorkflowStart" />
          <Property Name="WSEnabled" Value="true" />
          <Property Name="WSGUID" Value="19cbf8a6-4af8-462c-b014-c8d7c0e327c1" />
          <Property Name="WSEventSourceGUID" Value="{$ListId:Shared Documents;}" />
          <Property Name="Microsoft.SharePoint.ActivationProperties.ListId" Value="{$ListId:Shared Documents;}" />
          <Property Name="HistoryListId" Value="{$ListId:Lists/WorkflowHistoryList;}" />
          <Property Name="TaskListId" Value="{$ListId:Lists/WorkflowTaskList;}" />
        </File>
      </Module>
      <ListInstance FeatureId="{2c63df2b-ceab-42c6-aeff-b3968162d4b1}"
                    TemplateType="4501"
                    Title="wfsvc"
                    Description="This list instance is used by SharePoint to keep track of workflows. Do not modify."
                    Url="wfsvc"
                    RootWebOnly="FALSE" />
    </Elements>

    this GUID is 86c7e42d4fe14b839d55fcbb6dde7b9c. Remember this GUID, you will need it in the following step.
  6. Now you need to query workflow resource management database to find out the scope path of your workflow. If you left database name with default value during configuration of workflow farm, this query should get you the scope path (replace the GUID in query with GUID from the previous step):
    SELECT [Path]
    FROM [WFResourceManagementDB].[dbo].[Scopes] s
        join [WFResourceManagementDB].[dbo].[Activities] a on s.ScopeId = a.ScopeId
    where a.Name = 'WorkflowXaml_86c7e42d_4fe1_4b83_9d55_fcbb6dde7b9c'
  7. Now it's time to change x:Class attribute in the workflow.xaml file. Last token in the attribute should contain GUID from step 5. For example: x:Class="In2.Ilas.Sp.Ecase.PukWf.WorkflowXaml_ed00d3bd_4796_41ba_b288_35ce2226f89a"
  8. Finally, console application should have the following code (replace the path from step 6 and workflow name from step 5):
    using Microsoft.SharePoint;
    using Microsoft.SharePoint.Client;
    using Microsoft.SharePoint.Client.WorkflowServices;
    using Microsoft.Workflow.Client;
    using Microsoft.Workflow.Samples.Common;
    using System;
    using System.Collections.Generic;
    using System.Collections.Specialized;
    using System.Linq;
    using System.Net;
    using System.Text;
    using System.Threading.Tasks;
    using System.Linq;
    
    namespace ConsoleApplication1
    {
        class Program
        {
            static void Main(string[] args)
            {
                WorkflowManagementClient client = new WorkflowManagementClient("http://zg-sp2013-02:12291/SharePoint/default/030e8465-c66c-4f9f-83af-e64d5a4a799b/61aa1fff-103e-49c8-bc56-395c27ca7f81");
                client.Activities.Publish(new ActivityDescription(WorkflowUtils.Translate("Workflow.xaml")) { Name = "WorkflowXaml_ed00d3bd_4796_41ba_b288_35ce2226f89a" });
            }
        }
    } 
  9. Copy Workflow.xaml file to console application's folder.
  10. Run the application.
Now, old and already running instances will continue using old workflow definition while new instances will run using new workflow definition.

Complete solution is available for download.

List of types in C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PublicAssemblies\Microsoft.SharePoint.DesignTime.Activities.dll assembly:

namespace Microsoft.SharePoint.DesignTime.Activities
{
    [ComVisible(false)]
    public class AppOnlySequence : Activity, ISupportInitialize

    [ComVisible(false)]
    public class AtomicTaskItemUpdatedHelper : Activity, ISupportInitialize

    [ComVisible(false)]
    public class BuildSPListItemWebLink : Activity<string>, ISupportInitialize

    [ComVisible(false)]
    public class BuildSPUri : Activity<string>, ISupportInitialize

    [ComVisible(false)]
    public class Calc : Activity, ISupportInitialize

    [ComVisible(false)]
    public class CallHTTPWebService : Activity, ISupportInitialize

    [ComVisible(false)]
    public class CheckInItem : Activity, ISupportInitialize

    [ComVisible(false)]
    public class CheckOutItem : Activity, ISupportInitialize

    [ComVisible(false)]
    public class Comment : Activity, ISupportInitialize

    [ComVisible(false)]
    public class CompositeTask : Activity, ISupportInitialize

    [ComVisible(false)]
    public class CompositeTaskHelper : Activity<bool>, ISupportInitialize

    [ComVisible(false)]
    public class ConvertPropertiesForSPListItem : Activity, ISupportInitialize

    [ComVisible(false)]
    public class ConvertTimeZoneFromSPLocalToUtc : Activity<DateTime>, ISupportInitialize

    [ComVisible(false)]
    public class ConvertTimeZoneFromUtcToSPLocal : Activity<DateTime>, ISupportInitialize

    [ComVisible(false)]
    public class CopyItem : Activity, ISupportInitialize

    [ComVisible(false)]
    public class CreatedBy : Activity<bool>, ISupportInitialize

    [ComVisible(false)]
    public class CreatedInRange : Activity<bool>, ISupportInitialize

    [ComVisible(false)]
    public class CreateListItem : Activity<Guid>, ISupportInitialize

    [ComVisible(false)]
    public class DateInterval : Activity<double>, ISupportInitialize

    [ComVisible(false)]
    public class DefaultRetryPolicy : Activity, ISupportInitialize

    [ComVisible(false)]
    public class DelayFor : Activity, ISupportInitialize

    [ComVisible(false)]
    public class DelayUntil : Activity, ISupportInitialize

    [ComVisible(false)]
    public class DeleteListItem : Activity, ISupportInitialize

    [ComVisible(false)]
    public class Email : Activity, ISupportInitialize

    [ComVisible(false)]
    public class ExpandGroupToUsers : Activity<Collection<string>>, ISupportInitialize

    [ComVisible(false)]
    public class ExpandInitFormUsers : Activity<Collection<string>>, ISupportInitialize

    [ComVisible(false)]
    public class ExtractSubstringFromEnd : Activity<string>, ISupportInitialize

    [ComVisible(false)]
    public class ExtractSubstringFromIndex : Activity<string>, ISupportInitialize

    [ComVisible(false)]
    public class ExtractSubstringFromIndexLength : Activity<string>, ISupportInitialize

    [ComVisible(false)]
    public class ExtractSubstringFromStart : Activity<string>, ISupportInitialize

    [ComVisible(false)]
    public class GenerateEmailDynamicValue : Activity<DynamicValue>, ISupportInitialize

    [ComVisible(false)]
    public class GetCurrentItemGuid : Activity<Guid>, ISupportInitialize

    [ComVisible(false)]
    public class GetCurrentItemId : Activity<int>, ISupportInitialize

    [ComVisible(false)]
    public class GetCurrentListId : Activity<Guid>, ISupportInitialize

    [ComVisible(false)]
    public class GetHistoryListId : Activity<Guid>, ISupportInitialize

    [ComVisible(false)]
    public class GetItemIdInCache : Activity<bool>, ISupportInitialize

    [ComVisible(false)]
    public class GetTaskListId : Activity<Guid>, ISupportInitialize

    [ComVisible(false)]
    public class IsNull : Activity<bool>, ISupportInitialize

    [ComVisible(false)]
    public class IsSPListItemPropertyLookupToDocsField : Activity<bool>, ISupportInitialize

    [ComVisible(false)]
    public class IsValidUser : Activity<bool>, ISupportInitialize

    [ComVisible(false)]
    public class JoinChoicesFromSPFieldMultiChoice : Activity<string>, ISupportInitialize

    [ComVisible(false)]
    public class JoinIdOrValueFromSPFieldLookupMulti : Activity<string>, ISupportInitialize

    [ComVisible(false)]
    public class JoinSiteUserInfoListPropertyFromSPFieldUserMulti : Activity<string>, ISupportInitialize

    [ComVisible(false)]
    public class JoinSPPrincipalPropertyFromInitFormParamUserMulti : Activity<string>, ISupportInitialize

    [ComVisible(false)]
    public class LookupSPChoiceFieldIndex : Activity<int>, ISupportInitialize

    [ComVisible(false)]
    public class LookupSPField : Activity<DynamicValue>, ISupportInitialize

    [ComVisible(false)]
    public class LookupSPFields : Activity<DynamicValue>, ISupportInitialize

    [ComVisible(false)]
    public class LookupSPGroup : Activity<DynamicValue>, ISupportInitialize

    [ComVisible(false)]
    public class LookupSPGroupMembers : Activity<DynamicValue>, ISupportInitialize

    [ComVisible(false)]
    public class LookupSPList : Activity<DynamicValue>, ISupportInitialize

    [ComVisible(false)]
    public class LookupSPListItem : Activity<DynamicValue>, ISupportInitialize

    [ComVisible(false)]
    public class LookupSPListItemBooleanProperty : Activity<bool>, ISupportInitialize

    [ComVisible(false)]
    public class LookupSPListItemDateTimeProperty : Activity<DateTime>, ISupportInitialize

    [ComVisible(false)]
    public class LookupSPListItemDoubleProperty : Activity<double>, ISupportInitialize

    [ComVisible(false)]
    public class LookupSPListItemDynamicValueProperty : Activity<DynamicValue>, ISupportInitialize

    [ComVisible(false)]
    public class LookupSPListItemGuid : Activity<Guid>, ISupportInitialize

    [ComVisible(false)]
    public class LookupSPListItemId : Activity<int>, ISupportInitialize

    [ComVisible(false)]
    public class LookupSPListItemInt32Property : Activity<int>, ISupportInitialize

    [ComVisible(false)]
    public class LookupSPListItemProperty : Activity<DynamicValue>, ISupportInitialize

    [ComVisible(false)]
    public class LookupSPListItemPropertyNameInREST : Activity<string>, ISupportInitialize

    [ComVisible(false)]
    public class LookupSPListItemSPFieldLookupMultiProperty : Activity<DynamicValue>, ISupportInitialize

    [ComVisible(false)]
    public class LookupSPListItemSPFieldLookupProperty : Activity<DynamicValue>, ISupportInitialize

    [ComVisible(false)]
    public class LookupSPListItemStringProperty : Activity<string>, ISupportInitialize

    [ComVisible(false)]
    public class LookupSPListProperty : Activity<DynamicValue>, ISupportInitialize

    [ComVisible(false)]
    public class LookupSPPrincipal : Activity<DynamicValue>, ISupportInitialize

    [ComVisible(false)]
    public class LookupSPPrincipalId : Activity<int>, ISupportInitialize

    [ComVisible(false)]
    public class LookupSPPrincipalProperty : Activity<string>, ISupportInitialize

    [ComVisible(false)]
    public class LookupSPTaskAssignedToDisplayName : Activity<string>, ISupportInitialize

    [ComVisible(false)]
    public class LookupSPTaskListItemAssignedTo : Activity<Collection<string>>, ISupportInitialize

    [ComVisible(false)]
    public class LookupSPUser : Activity<DynamicValue>, ISupportInitialize

    [ComVisible(false)]
    public class LookupSPUserProperty : Activity<string>, ISupportInitialize

    [ComVisible(false)]
    public class LookupWorkflowContextProperty : Activity<string>, ISupportInitialize

    [ComVisible(false)]
    public class LoopNTimes : Activity, ISupportInitialize

    [ComVisible(false)]
    public class ModifiedBy : Activity<bool>, ISupportInitialize

    [ComVisible(false)]
    public class ModifiedInRange : Activity<bool>, ISupportInitialize

    [ComVisible(false)]
    public class RegisterForSharePointEvent : Activity, ISupportInitialize

    [ComVisible(false)]
    public class ReplaceEmailTokens : Activity<string>, ISupportInitialize

    [ComVisible(false)]
    public class RetryForDurationPolicy : Activity, ISupportInitialize

    [ComVisible(false)]
    public class SetField : Activity, ISupportInitialize

    [ComVisible(false)]
    public class SetItemIdInCache : Activity, ISupportInitialize

    [ComVisible(false)]
    public class SetRelatedItem : Activity, ISupportInitialize

    [ComVisible(false)]
    public class SetTimeField : Activity<DateTime>, ISupportInitialize

    [ComVisible(false)]
    public class SetWorkflowStatus : Activity, ISupportInitialize

    [ComVisible(false)]
    public class SingleTask : Activity, ISupportInitialize

    [ComVisible(false)]
    public class TranslateDocument : Activity, ISupportInitialize

    [ComVisible(false)]
    public class UndoCheckOutItem : Activity, ISupportInitialize

    [ComVisible(false)]
    public class UpdateListItem : Activity, ISupportInitialize

    [ComVisible(false)]
    public class WaitForCustomEvent : Activity<string>, ISupportInitialize

    [ComVisible(false)]
    public class WaitForFieldChange : Activity, ISupportInitialize

    [ComVisible(false)]
    public class WaitForItemEvent : Activity, ISupportInitialize

    [ComVisible(false)]
    public class WebUri : Activity<string>, ISupportInitialize

    [ComVisible(false)]
    public class WordsInTitle : Activity<bool>, ISupportInitialize

    [ComVisible(false)]
    public class WorkflowInterop : Activity<Guid>, ISupportInitialize

    [ComVisible(false)]
    public class WriteToHistory : Activity, ISupportInitialize
}

namespace Microsoft.SharePoint.DesignTime.Activities.Expressions
{
    [ComVisible(false)]
    public class ContainsStringIgnoreCase : Activity<bool>, ISupportInitialize

    [ComVisible(false)]
    public class IsEqualDate : Activity<bool>, ISupportInitialize

    [ComVisible(false)]
    public class IsEqualDateTime : Activity<bool>, ISupportInitialize

    [ComVisible(false)]
    public class IsEqualDynamicValue : Activity<bool>, ISupportInitialize

    [ComVisible(false)]
    public class IsEqualStringIgnoreCase : Activity<bool>, ISupportInitialize

    [ComVisible(false)]
    public class IsEqualUser : Activity<bool>, ISupportInitialize

    [ComVisible(false)]
    public class IsGreaterThanDateTime : Activity<bool>, ISupportInitialize

    [ComVisible(false)]
    public class IsGreaterThanOrEqualDateTime : Activity<bool>, ISupportInitialize

    [ComVisible(false)]
    public class IsLessThanDateTime : Activity<bool>, ISupportInitialize

    [ComVisible(false)]
    public class IsLessThanOrEqualDateTime : Activity<bool>, ISupportInitialize

    [ComVisible(false)]
    public class MatchesString : Activity<bool>, ISupportInitialize
}

namespace XamlStaticHelperNamespace
{
    [GeneratedCode("XamlBuildTask", "4.0.0.0")]
    internal class _XamlStaticHelper
}



2015-08-19

Failed to load receiver assembly, System.IO.FileNotFoundException: Could not load file or assembly or one of its dependencies on Feature Receiver in SharePoint 2013

After breaking the deploy process by pressing CTRL+BREAK during Visual Studio 2012 deploy of SharePoint 2013 WSP I wasn't able to deploy my package any more. Deploy was failing with the message:

Failed to load receiver assembly...

After fiddling with Process Monitor and Fusion Log for a while I couldn't pinpoint why assembly couldn't be loaded. Assembly exists at appropriate location in GAC but my concern is that Visual Studio tries to access it few seconds before it is actually copied to GAC during deploy process. Aforementioned exception happens during feature activation phase of deploy process.

My solution to the problem was to change assembly version from 1.0.0.0 to 1.0.0.1 and build the SharePoint project. After that I I deleted feature receiver and added feature receiver again so that feature manifest XML file gets updated with correct version of feature receiver assembly.