List Aggregator App (SPFx)

The type or namespace WorkflowServicesManager could not be found error in csom SharePoint online

SharePoint Visual studio 2015 The type or namespace WorkflowServicesManager could not be found

Here we will discuss how to resolve the below issue which comes in a console application developed to work with workflows in SharePoint online. In that online, I was trying to retrieve workflows presented in the site.

The code was like below:

SharePoint deveopment training course

using (ClientContext ctx = new ClientContext(URL))
{
ctx.AuthenticationMode = ClientAuthenticationMode.Default;
ctx.Credentials = new SharePointOnlineCredentials(GetSPOAccountName(), GetSPOSecureStringPassword());
ctx.Load(ctx.Web);
ctx.ExecuteQuery();

var workflowServicesManager = new WorkflowServicesManager(ctx, ctx.Web);
}

Also, read:

– Step by step develop workflows using visual studio 2015 as an add in and deploy to host web in SharePoint online?

– How to delete all items from SharePoint online list using Rest API?

But it gave an error in the below line:

var workflowServicesManager = new WorkflowServicesManager(ctx, ctx.Web);

The error looks like:

The type or namespace WorkflowServicesManager could not be found (are you missing a using directive or an assembly reference?).

The type or namespace WorkflowServicesManager could not be found
The type or namespace WorkflowServicesManager could not be found

Solution:
We need to add the Microsoft.SharePoint.Client.WorkflowServices.dll inside our console application. We can add the dll refernece from NuGet.

Right click on References folder in the solution explorer -> Manage NuGet Packages….

Sharepoint online The type or namespace WorkflowServicesManager could not be found
Sharepoint online The type or namespace WorkflowServicesManager could not be found

Then in the NuGet Package Manager search for “Microsoft.SharePoint.Client.WorkflowServices” and then Install like below:

SharePoint Visual studio 2015 The type or namespace WorkflowServicesManager could not be found
SharePoint Visual studio 2015 The type or namespace WorkflowServicesManager could not be found

Once successfully installed you should be able to add the using statement like below:

using Microsoft.SharePoint.Client.WorkflowServices;


Then the error will not appear.

Hope this will be helpful.

Check out Best Alternative to InfoPath -> Try Now

free sharepoint training

SharePoint Online FREE Training

JOIN a FREE SharePoint Video Course (3 Part Video Series)

envelope
envelope

About Bhawana Rathore

Hello Everyone!! I am Bhawana a SharePoint MVP and having about 8+ years of SharePoint experience as well as in .Net technologies . I have worked in all the versions of SharePoint from wss to Office 365. I have good exposure in Customization and Migration using Nintex, Metalogix tools . Now exploring more in SharePoint 2016 :) Hope here I can contribute and share my knowledge to the fullest. As I believe "There is no wealth like knowledge, and no poverty like ignorance"

View all posts by Bhawana Rathore →