Your question has been submitted and is awaiting moderation.
Thank you for reporting this content, moderators have been notified of your submission.
I'd like to create a simple Windows console application which would be able to delete DNN user by Id. How do I do it? My first attempt to call UserController.GetUserById() from a console app caused a null reference exception with the following stack trace:
w DotNetNuke.Common.Globals.get_Status()
w DotNetNuke.Entities.Portals.PortalController.GetEffectivePortalId(Int32 portalId)
w DotNetNuke.Entities.Users.UserController.GetEffectivePortalId(Int32 portalId)
w DotNetNuke.Entities.Users.UserController.GetUserLookupDictionary(Int32 portalId)
w DotNetNuke.Entities.Users.UserController.GetUserById(Int32 portalId, Int32 userId)
w DNNUserManager.Program.DeleteDNNUser(Int32 dnnUserId) w c:\Users\przemyslaw.janik\TFS\WJW\Karcher\Trunk\DNNUserManager\Program.cs:wiersz 21
w DNNUserManager.Program.Main(String[] args) w c:\Users\przemyslaw.janik\TFS\WJW\Karcher\Trunk\DNNUserManager\Program.cs:wiersz 16
w System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
w System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
w Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
w System.Threading.ThreadHelper.ThreadStart_Context(Object state)
w System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
w System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
w System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
w System.Threading.ThreadHelper.ThreadStart()