Object reference not set to an instance of an object. at DotNetNuke.Entities.Users.UserInfo.GetProperty

DNN Error Object reference not set to an instance of an object. at DotNetNuke.Entities.Users.UserInfo.GetProperty

After noticing a few strange things with our website, and seeing a number of users requesting access, but not receiving their authentication email. We noticed this error when we manually authorised an account.

Message: DotNetNuke.Services.Exceptions.ModuleLoadException: Object reference not set to an instance of an object. —> System.NullReferenceException: Object reference not set to an instance of an object. at DotNetNuke.Entities.Users.UserInfo.GetProperty(String propertyName, String format, CultureInfo formatProvider, UserInfo accessingUser, Scope currentScope, Boolean& propertyNotFound) at DotNetNuke.Services.Tokens.BaseCustomTokenReplace.replacedTokenValue(String strObjectName, String strPropertyName, String strFormat) at DotNetNuke.Services.Tokens.BaseTokenReplace.ReplaceTokens(String strSourceText) at DotNetNuke.Services.Tokens.TokenReplace.ReplaceTokens(String strSourceText) at DotNetNuke.Services.Tokens.TokenReplace.ReplaceEnvironmentTokens(String strSourceText, IDictionary Custom, String CustomCaption) at DotNetNuke.Services.Localization.Localization.GetSystemMessage(String strLanguage, PortalSettings portalSettings, String messageName, UserInfo userInfo, String resourceFile, ArrayList customArray, IDictionary customDictionary, String customCaption, Int32 accessingUserID) at DotNetNuke.Services.Localization.Localization.GetSystemMessage(String strLanguage, PortalSettings portalSettings, String messageName, UserInfo userInfo, String resourceFile, ArrayList custom, String customCaption, Int32 accessingUserID) at DotNetNuke.Services.Mail.Mail.SendMail(UserInfo user, MessageType msgType, PortalSettings settings) at DotNetNuke.Modules.Admin.Users.ManageUsers.MembershipAuthorized(Object sender, EventArgs e) — End of inner exception stack trace —Message: DotNetNuke.Services.Exceptions.ModuleLoadException: Object reference not set to an instance of an object. —> System.NullReferenceException: Object reference not set to an instance of an object. at DotNetNuke.Entities.Users.UserInfo.GetProperty(String propertyName, String format, CultureInfo formatProvider, UserInfo accessingUser, Scope currentScope, Boolean& propertyNotFound) at DotNetNuke.Services.Tokens.BaseCustomTokenReplace.replacedTokenValue(String strObjectName, String strPropertyName, String strFormat) at DotNetNuke.Services.Tokens.BaseTokenReplace.ReplaceTokens(String strSourceText) at DotNetNuke.Services.Tokens.TokenReplace.ReplaceTokens(String strSourceText) at DotNetNuke.Services.Tokens.TokenReplace.ReplaceEnvironmentTokens(String strSourceText, IDictionary Custom, String CustomCaption) at DotNetNuke.Services.Localization.Localization.GetSystemMessage(String strLanguage, PortalSettings portalSettings, String messageName, UserInfo userInfo, String resourceFile, ArrayList customArray, IDictionary customDictionary, String customCaption, Int32 accessingUserID) at DotNetNuke.Services.Localization.Localization.GetSystemMessage(String strLanguage, PortalSettings portalSettings, String messageName, UserInfo userInfo, String resourceFile, ArrayList custom, String customCaption, Int32 accessingUserID) at DotNetNuke.Services.Mail.Mail.SendMail(UserInfo user, MessageType msgType, PortalSettings settings) at DotNetNuke.Modules.Admin.Users.ManageUsers.MembershipAuthorized(Object sender, EventArgs e) — End of inner exception stack trace —

The account was authorised, but DNN threw this error.

The error was traced back to the token function of the automatic email messages in DotNetNuke. Email messages were not being generated, and no users were being authorised. 

The long and the short of it was that the defined Administrator account was inadvertently removed from the site. This in turn stopped DNN from being able to generate any email messages with tokens for the Admin account email address.

The fix

was as easy as putting an admin account back into the site.

Author: InteractiveWebs

This blog is the combined blog work of the InteractiveWebs Dev Team. Together we work on a range of DotNetNuke (DNN) applications, modules, Silverlight, and Microsoft CRM Portal integration products. Our Business is website design and hosting, with a strong focus on DotNetNuke, Microsoft Dynamics CRM, Silverlight and iPhone iPad development.

4 thoughts on “Object reference not set to an instance of an object. at DotNetNuke.Entities.Users.UserInfo.GetProperty”

  1. Hi,

    If anybody is still active in this topic , I face the similar problem. I also have admin acount already setup but still receive the same error on adding/deleting users.

    Thanks
    Kulwinder

Leave a Reply

Your email address will not be published. Required fields are marked *