I can see that this is an old thread, but the topic is dead-on.
i am working with DNN Community 4.9.5. As soon as I call InitialiseProfile(0), I get an error.
"The type initializer for 'DotNetNuke.Entities.Profile.ProfileController' threw an exception."
The InnerException reads:
"System.TypeInitializationException: The type initializer for 'DotNetNuke.Data.DataProvider' threw an exception. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at DotNetNuke.Framework.Reflection.CreateObject(String ObjectProviderType, String ObjectProviderName, String ObjectNamespace, String ObjectAssemblyName, Boolean UseCache) in C:\Inetpub\wwwroot\495\Library\Components\Framework\Reflection.vb:line 172
at DotNetNuke.Framework.Reflection.CreateObject(String ObjectProviderType, String ObjectNamespace, String ObjectAssemblyName) in C:\Inetpub\wwwroot\495\Library\Components\Framework\Reflection.vb:line 94
at DotNetNuke.Data.DataProvider.CreateProvider() in C:\Inetpub\wwwroot\495\Library\Components\Providers\Data\DataProvider.vb:line 44
at DotNetNuke.Data.DataProvider..cctor() in C:\Inetpub\wwwroot\495\Library\Components\Providers\Data\DataProvider.vb:line 39
--- End of inner exception stack trace ---
at DotNetNuke.Data.DataProvider.Instance()
at DotNetNuke.Entities.Profile.ProfileController..cctor() in C:\Inetpub\wwwroot\495\Library\Components\Users\Profile\ProfileController.vb:line 48"
Can you suggest where to look?
Thanks.