We have a rather complex set-up with our DNN membership being in a separate profile database.
I have been asked to create a web service in order to synchronise our databases and I want to use the DNN Framework to simply retrieve, update and delete users and roles.
I have added a references to the DotNetNuke.dll and the DotNetNuke.Membership.Dataprovider.dll in the web service and I have also added connection strings and AppSettings in my web service web.config file that match a DNN installation.
However whenever I try to retrieve a user using the following code (with a valid PortalID & username):
Dim dnnUserInfo As DotNetNuke.Entities.Users.UserInfo = UserController.GetUserByName(pvUserInfo.PortalID, pvUserInfo.UserName)
I get the following error:
{"The type initializer for 'DotNetNuke.Entities.Users.UserController' threw an exception."}
System.TypeInitializationException: {"The type initializer for 'DotNetNuke.Entities.Users.UserController' threw an exception."}
Data: {System.Collections.ListDictionaryInternal}
HelpLink: Nothing
InnerException: {"The type initializer for 'DotNetNuke.Security.Membership.MembershipProvider' threw an exception."}
Message: "The type initializer for 'DotNetNuke.Entities.Users.UserController' threw an exception."
Source: "DotNetNuke"
StackTrace: " at DotNetNuke.Entities.Users.UserController.GetUserByName(Int32 portalId, String username) at DNNPortalWebService.DNNPortal.UpdateUser(Int32 i) in D:\HRGPortal\Web Services\DNNPortalWebService\DNNPortal.asmx.vb:line 31"
TargetSite: {System.Reflection.RuntimeMethodInfo}
So am I doing something fundamentally wrong?
Or can I not use the DNN framework outside of a DNN installation?