0
votes

I am creating a console application that needs to access to Umbraco members in order to do some maintenance jobs.

What I want to do is get all the users for a specific role:

Roles.GetUsersInRole("SomeRole");

I added an app.config file and referenced the assemblies I thought were required. I might be missing something, since I get the following error:

Unhandled Exception: System.TypeLoadException: Could not load type 'umbraco.providers.members.UmbracoRoleProvider' from assembly 'System.Web, Version=4.0.0.0
at System.Web.Security.Roles.Initialize()
1
First of all, did you test the console environment so it's working as supposed, can you select nodes and documents? - Eric Herlitz

1 Answers

1
votes

The Umbraco APIs don't work outside of an HttpContext - it's one of the current limitations that the MVC version, v5, was meant to address (before it was officially mothballed in June 2012).

However, there is a set of web services which may do what you require - check /umbraco/webservices/api/MemberService.asmx in you installation and reference it in your console app - if you reference that, then you can work with the member store outside of a direct HttpContext.