I have been unable to programmatically create a portal. I keep getting an error and I don't know what I am doing wrong. FYI, I am working with DotNetNuke 3.3
The error is happening in Reflection.VB
" ' get the typename of the default DataProvider from web.config
TypeName = CType(objProviderConfiguration.Provider(objProviderConfiguration.DefaultProvider), Provider).Type
Here is the Error:
Error Generated trying to create Portal The type initializer for "DotNetNuke.Services.Cache.CachingProvider" threw an exception. at DotNetNuke.Services.Cache.CachingProvider.Instance()
Here is my code (cpEComCBO is a CBO of portal information being passed to the function):
Dim dnnPortalObj As New DotNetNuke.Entities.Portals.PortalController
'Create Portal
With cpEComCBO
iPortalID = dnnPortalObj.CreatePortal(.PortalName, _
AdminParams.FirstName, _
AdminParams.LastName, _
AdminParams.Username, _
AdminParams.Password, _
AdminParams.Email, _
.PortalDescription, _
.PortalKeyWords, _
strTemplatePath, _
.PortalTemplate, _
"Portals/9", _
.PortalAlias, _
"", _
"", _
True)
End With
Please Help, I am getting killed!!!
Thank you ,
Preston
Here is the complete stack trace:
Error Generated trying to create Portal The type initializer for "DotNetNuke.Services.Cache.CachingProvider" threw an exception. at DotNetNuke.Services.Cache.CachingProvider.Instance()
at DotNetNuke.Common.Utilities.DataCache.GetCache(String CacheKey)
at DotNetNuke.Services.Localization.Localization.GetSupportedLocales()
at DotNetNuke.Services.Localization.Localization.GetResource(String ResourceFileRoot, PortalSettings objPortalSettings, String strLanguage)
at DotNetNuke.Services.Localization.Localization.GetString(String name, String ResourceFileRoot, PortalSettings objPortalSettings, String strLanguage)
at DotNetNuke.Services.Localization.Localization.GetString(String name)
at DotNetNuke.Entities.Portals.PortalController.CreatePortal(String PortalName, String FirstName, String LastName, String Username, String Password, String Email, String Description, String KeyWords, String TemplatePath, String TemplateFile, String HomeDirectory, String PortalAlias, String ServerPath, String ChildPath, Boolean IsChildPortal)